mysql查看当前实时连接数

mysql查看当前实时连接数
静态查看:

SHOW PROCESSLIST;  
SHOW FULL PROCESSLIST;  
SHOW VARIABLES LIKE '%max_connections%';  
SHOW STATUS LIKE '%Connection%'; 

实时查看:
mysql> show status like ‘Threads%’;

Threads_cached 30
Threads_connected 152
Threads_created 1736143
Threads_rejected 0
Threads_running 3

Threads_connected 跟show processlist结果相同,表示当前连接数。
Threads_running是代表当前并发数

这是是查询数据库当前设置的最大连接数
mysql> show variables like ‘%max_connections%’;

extra_max_connections
max_connections 16512

你可能感兴趣的:(mysql)