DB/MySQL
MySQL 프로세스 리스트 보기
적외선
2011. 4. 22. 10:51
[출처] http://breakpoint.tistory.com/127
MySQL 프로세스 리스트 보기에는 다음의 두가지 방법을 사용
[aokio]$ mysqladmin
processlist
mysql>
show
processlist;
+---------+------+-----------+-------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+---------+------+-----------+-------+---------+------+-------+------------------+
| 1602724 | root | localhost | test | Sleep | 70 | | NULL |
| 1603286 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+---------+------+-----------+-------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
+---------+------+-----------+-------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+---------+------+-----------+-------+---------+------+-------+------------------+
| 1602724 | root | localhost | test | Sleep | 70 | | NULL |
| 1603286 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+---------+------+-----------+-------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
프로세스 죽이기.
해당 아이디 번호를 가지고 킬하면 프로세스를 종료시킬 수 있다.
mysql> kill 1602724;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql>
show
processlist;
+---------+------+-----------+-------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+---------+------+-----------+-------+---------+------+-------+------------------+
| 1603286 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+---------+------+-----------+-------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
+---------+------+-----------+-------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+---------+------+-----------+-------+---------+------+-------+------------------+
| 1603286 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+---------+------+-----------+-------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
Info : 현 실행되고 있는 SQL .
"SHOW PROCESSLIST" 최대 100자까지 표시
전부 표시하려면 "SHOW FULL PROCESSLIST"
[출처] [펌] mysql process 강제종료|작성자 잠자는유령