How to kill blocked mysql queries

I create and test a mysql connection request, but every time so far it makes the database tables lock and the site freezes. Then I have to call the host and they kill the blocked requests. Is there something I can do from phpmyadmin so as not to bother them while I configure the script to work? Thanks for any answer.

+3
source share
4 answers

This can be done on the first page of phpMyAdmin. Find the Processes link.

You can also run the command SHOW PROCESSLIST(or SHOW FULL PROCESSLIST). This will show you all the queries you can manipulate (i.e. your own). Along with each request there will be an identifier. You can send a command to KILLany of these identifiers to kill the request.

In addition, you should consider testing your request with EXPLAIN.

+13
source

I don't know about phpMyAdmin, but the free mysql tools package contains an application called MySql Adminstrator that allows you to do just that. It shows that you are executing requests and provides a "kill thread" button (on the server health tab, I believe).

Mysql GUI Tools/Mysql Workbench phpMyAdmin. ssh, phpMyAdmin.

0

I do not remember the way to do this with phpmyadmin. You can try checking your query in a local test copy of the database rather than live to get better throughput until it is no longer blocked.

0
source

The easiest way to do this is through mytop, press "k" and enter the identifier of the thread you want to kill.

   Id      User         Host/IP         DB       Time    Cmd    State Query                                                                                                                
   --      ----         -------         --       ----    ---    ----- ----------                                                                                                           
0
source

Source: https://habr.com/ru/post/1742742/


All Articles