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 // 數據庫設置最大連接數