- A+
所属分类:数据库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
mysql> show full processlist; +-----+------+----------------------+------+---------+-------+----------+-----------------------+ | Id | User | Host | db | Command | Time | State | Info | +-----+------+----------------------+------+---------+-------+----------+-----------------------+ | 77 | root | 192.168.50.207:38356 | hryj | Sleep | 5 | | NULL | | 92 | root | 192.168.50.207:38742 | hryj | Sleep | 18 | | NULL | | 97 | root | 192.168.50.207:38842 | hryj | Sleep | 15 | | NULL | | 101 | root | 192.168.50.207:38854 | hryj | Sleep | 4 | | NULL | | 102 | root | 192.168.50.207:38856 | hryj | Sleep | 14555 | | NULL | | 259 | root | 192.168.50.207:33552 | hryj | Sleep | 22371 | | NULL | | 260 | root | 192.168.50.207:33554 | hryj | Sleep | 22371 | | NULL | | 261 | root | 192.168.50.207:33556 | hryj | Sleep | 4642 | | NULL | | 262 | root | 192.168.50.207:33558 | hryj | Sleep | 11486 | | NULL | | 263 | root | 192.168.50.207:33560 | hryj | Sleep | 29 | | NULL | | 264 | root | 192.168.50.138:7073 | NULL | Sleep | 21495 | | NULL | | 265 | root | 192.168.50.138:7079 | hryj | Sleep | 21493 | | NULL | | 266 | root | 192.168.50.138:7094 | hryj | Sleep | 20811 | | NULL | | 268 | root | 192.168.50.138:9197 | hryj | Sleep | 20564 | | NULL | | 644 | root | 192.168.50.207:46688 | hryj | Sleep | 11486 | | NULL | | 645 | root | 192.168.50.207:46690 | hryj | Sleep | 11486 | | NULL | | 647 | root | 192.168.50.207:46694 | hryj | Sleep | 11486 | | NULL | | 650 | root | 192.168.50.207:46700 | hryj | Sleep | 11485 | | NULL | | 658 | root | 192.168.50.207:46716 | hryj | Sleep | 4565 | | NULL | | 660 | root | 192.168.50.207:33878 | hryj | Sleep | 7593 | | NULL | | 661 | root | 192.168.50.207:33880 | hryj | Sleep | 7593 | | NULL | | 662 | root | 192.168.50.207:33882 | hryj | Sleep | 7593 | | NULL | | 663 | root | 192.168.50.207:33884 | hryj | Sleep | 7593 | | NULL | | 664 | root | 192.168.50.207:33886 | hryj | Sleep | 8 | | NULL | | 665 | root | 192.168.50.207:33932 | hryj | Sleep | 7584 | | NULL | | 666 | root | 192.168.50.207:33974 | hryj | Sleep | 7584 | | NULL | | 667 | root | 192.168.50.207:33976 | hryj | Sleep | 7584 | | NULL | | 668 | root | 192.168.50.207:33978 | hryj | Sleep | 7584 | | NULL | | 669 | root | 192.168.50.207:33980 | hryj | Sleep | 0 | | NULL | | 670 | root | localhost | NULL | Query | 0 | starting | show full processlist | +-----+------+----------------------+------+---------+-------+----------+-----------------------+ 30 rows in set (0.02 sec) |
如果用like会报sql错误
查询出来一堆sleep,这个还是测试环境,正式环境都是几百个,可是我只要查询query的
show full processlist取的是information_schema里面PROCESSLIST类容,我们直接取过滤
1 2 3 4 5 6 7 8 |
mysql> select * from `information_schema`.`PROCESSLIST` WHERE Command="Query"; +-----+------+-----------+------+---------+------+-----------+-------------------------------------------------------------------------+ | ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | +-----+------+-----------+------+---------+------+-----------+-------------------------------------------------------------------------+ | 670 | root | localhost | NULL | Query | 0 | executing | select * from `information_schema`.`PROCESSLIST` WHERE Command="Query" | +-----+------+-----------+------+---------+------+-----------+-------------------------------------------------------------------------+ 1 row in set (0.00 sec) |
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫