The command itself is simple to run from the MySQL client:


Note that since this command displays currently executing queries, it is only available to users with the SUPER privilege (such as the MySQL root user). A number of different states are possible for each connection—the MySQL manual lists them, together with explanations of each.

In addition to viewing processes, users with the SUPER privilege can also kill running threads—for example, threads which have “gone zombie” and are either not responding or tying up server resources—with the KILL command. To kill a thread completely, use the KILL command followed by the thread ID returned by SHOW PROCESSLIST:

mysql> KILL 27;
Query OK, 0 rows affected (0.05 sec)

Post By Editor (2,827 Posts)

Website: →