The command itself is simple to run from the MySQL client:
mysql> SHOW PROCESSLIST;
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)