1. 静态查看
SHOW PROCESSLIST;
SHOW FULL PROCESSLIST;
SHOW VARIABLES LIKE '%max_connections%';
SHOW STATUS LIKE '%Connection%';
2. 实时查看
show status like 'Threads%';
说明
Thread_cached:The number of threads in the thread cache
Thread_connected:The number of currently open connections.
Thread_created:The number of threads created to handle connections.
Thread_running:The number of threads that are not sleeping.
show variables like '%max_connections%';
max_connections // 数据库设置最大连接数