[Level 3] Show MySQL Porcess in CentOS

Three processes to get process info:

1. show all process:
mysq> show processlist;
+----+------+-----------------+------+---------+------+-------+------------------+
| Id | User | Host            | db   | Command | Time | State | Info             |
+----+------+-----------------+------+---------+------+-------+------------------+
|  1 | root | localhost:47605 | NULL | Sleep   |   27 |       | NULL             |
| 16 | root | localhost       | test | Query   |    0 | NULL  | show processlist |
+----+------+-----------------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)

2. get process that use port 47605:

mysql> \! netstat -ntp | grep 47605
tcp        0      0 127.0.0.1:47605             127.0.0.1:3306              ESTABLISHED 2629/mysql-monitor-
tcp        0      0 127.0.0.1:3306              127.0.0.1:47605             ESTABLISHED 17920/mysqld

3. get process that pid equal 2629:
mysql> \! netstat -ntp | grep 2629



Wish this helps.

regards,
Stanley Huang

Comments

Popular posts from this blog

[Level 2] Shell Interactive With Zenity Episode 5 -- list

[Level 2] iif in Python