How to findout the running process in Mysql and Kill The process.

You can use show processlist command to find out the running process in Mysql Server.Use the kill command to kill a process.

mysql> show processlist;
+----------+-------------+------------------+---------------------+---------+--------+-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| Id       | User        | Host             | db                  | Command | Time   | State                                                                 | Info                                                                                                 |
+----------+-------------+------------------+---------------------+---------+--------+-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
|        5 | system user |                  | NULL                | Connect | 429194 | Waiting for master to send event                                      | NULL                                                                                                 |
|        6 | system user |                  | NULL                | Connect |   1347 | Has read all relay log; waiting for the slave I/O thread to update it | NULL                                                                                                 |
| 51831040 | quiktest      | 172.16.1.4:42293 | kijiji_presentation | Sleep   |      3 |                                                                       | NULL                                                                                                 |
| 51885089 | quiktest       | 172.16.1.4:14375 | kijiji_presentation | Sleep   |      2 |                                                                       | NULL                                                                                                 |
| 51885645 | root        | localhost        | NULL                | Query   |      0 | NULL                                                                  | show processlist                                                                                     |
| 51885750 | quiktest       | 172.16.1.4:16096 | kijiji_presentation | Sleep   |      1 |                                                                       | NULL                                                                                                 |
| 51885935 | quiktest       | 172.16.1.4:16525 | kijiji_presentation | Sleep   |      1 |                                                                       | NULL                                                                                                 |
| 51886390 | quiktest       | 172.16.1.4:18194 | kijiji_presentation | Query   |      0 | Sending data                                                          | SELECT bn.node_id FROM babel_node bn,babel_area ba WHERE bn.nod_globalId=0 and bn.nod_areaname='Delh |
| 51886433 | quiktest       | 172.16.1.4:18332 | kijiji_presentation | Sleep   |      0 |                                                                       | NULL                                                                                                 |
| 51886434 | quiktest       | 172.16.1.4:18334 | kijiji_presentation | Sleep   |      0 |                                                                       | NULL                                                                                                 |
| 51886435 | quiktest       | 172.16.1.4:18337 | kijiji_presentation | Sleep   |      0 |                                                                       | NULL                                                                                                 |
+----------+-------------+------------------+---------------------+---------+--------+-----------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
11 rows in set (0.00 sec)

mysql>

To kill use the kill command just like below

mysql> kill  51906895 ;

Post By Editor (2,827 Posts)

Website: →

Connect