DB관련/MySQL
MySQL 프로세스 리스트 보기 , 프로세스 죽이기.
saltdoll
2017. 4. 20. 07:24
반응형
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"
출처: http://unabated.tistory.com/entry/MySQL-프로세스-리스트-보기 [랄라라]
반응형