show status like '%max_connections%'; ##mysql最大連接數
set global max_connections=1000 ##重新設置
show variables like '%max_connections%'; ##查詢數據庫當前設置的最大連接數
show global status like 'Max_used_connections'; ##服務器響應的最大連接數
show status like 'Threads%';
Variable_name Value
Threads_cached 0 ##mysql管理的線程池中還有多少可以被復用的資源
Threads_connected 152 ##打開的連接數
Threads_created 550 ##表示創建過的線程數,如果發現Threads_created值過大的話,表明MySQL服務器一直在創建線程,這也是比較耗資源,可以適當增加配置文件中thread_cache_size值,查詢服務器
Threads_running 1 ##激活的連接數,這個數值一般遠低於connected數值,准確的來說,Threads_running是代表當前並發數
show variables like 'thread_cache_size';
set global thread_cache_size=60;
