Linux DB

mysql processlist 확인 하기

2008.05.21 20:04

jook 조회 수:24747

mysqladmin 명령을 이용하거나, mysql 접속후 쿼리 문을 이용해서, 아래와 같이 현재 실행되고 있는 mysql 프로세스 리스트를 확인 할 수 있다.

[root@localhost root]# /usr/local/mysql/bin/mysqladmin processlist -p
Enter password:
+-------+------+-----------+----+---------+------+-------+------------------+
| Id    | User | Host      | db | Command | Time | State | Info             |
+-------+------+-----------+----+---------+------+-------+------------------+
| 13852 | root | localhost |    | Query   | 0    |       | show processlist |
+-------+------+-----------+----+---------+------+-------+------------------+
[root@localhost root]#
[root@localhost root]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 13868 to server version: 5.0.18-log

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> show processlist;
+-------+------+-----------+------+---------+------+-------+------------------+
| Id    | User | Host      | db   | Command | Time | State | Info             |
+-------+------+-----------+------+---------+------+-------+------------------+
| 13868 | root | localhost | NULL | Query   |    0 | NULL  | show processlist |
+-------+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)

mysql>