進入mysql命令行:mysql的安裝目錄下面有個bin目錄,先用命令進入該目錄,然後用 mysql -uroot -p123456 來登錄。
show variables like '%max_connections%'; 查看最大連接數
//set global max_connections=1000; 修改最大連接數
show processlist; root帳號,能看到所有用戶的當前連接。其它普通帳號,只能看到自己佔用的連接。只會列出前100條,如果想全列出請使用show full processlist;
//show status; 當前狀態展示
show status like 'Threads_connected'; 當前已連接上的線程數。show status like 'Thread%'
like '參數':
Aborted_connects 嘗試已經失敗的MySQL服務器的連接的次數。
Connections 試圖連接MySQL服務器的次數。
Max_used_connections 同時使用的連接的最大數目。
Threads_connected 當前打開的連接的數量。
Threads_running 不在睡眠的線程數量,併發數。