Searching...
19/4/11

Show MySQL process list

01:38
Sometimes we need to find out who is doing what, and kill the process if needed in MySQL. To do this, all you have to do is to query show processlist in the MySQL interface as follows:

mysql> show processlist;
It will display something like:

+-----+-------+-----------+----------+---------+------+-------+------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+-------+-----------+----------+---------+------+-------+------+
| 709 | admin | localhost | database | Sleep | 879 | | NULL |
| 710 | admin | localhost | database | Sleep | 766 | | NULL |
| 711 | admin | localhost | database | Sleep | 1330 | | NULL |
+-----+-------+-----------+----------+---------+------+-------+------+

To kill the process, you can do the following:
mysql> kill 709;

0 comments:

Đăng nhận xét