How to Kill / Stop the Specific MySQL Query Process

We can easily stop the unwanted MySQL query process using mysqladmin command

First of all check the MySQL query process list.

—–+————–+———–+————–+———+——+——-+——————+
| Id     | User         | Host      | db           | Command | Time | State | Info |
+——–+————–+———–+————–+———+——+——-+——————+
|   7605 | eximstats    | localhost | eximstats    | Sleep   |  296 |       | NULL |
| 218382 | modsec       | localhost | modsec       | Sleep   | 4181 |       | NULL |
| 219303 | leechprotect | localhost | leechprotect | Sleep   | 3926 |       | NULL |
| 219552 | root         | localhost | NULL         | Query   |    0 | NULL  | show processlist |
+——–+————–+———–+————–+———+——+——-+——————+

Now to kill the process PID run the following command:

mysqladmin -u root -p kill  PID 

If you don’t have set root password, you can run:

mysqladmin -u root kill  219303