「我的電腦」→ 右鍵「管理」→ 「服務與應用程式」→ 「服務」→ 找到 MySQL → 右鍵「重新啟動」/「停止」/「啟動」。
net stop mysql
net start mysql
可存為 mysqlreset.bat 一鍵執行。
service mysqld start|stop|restart
原因:連線數超過 max_connections,且 wait_timeout 過長導致閒置連線堆積。
解決:修改 my.ini (Windows) 或 my.cnf (Linux):
[mysqld]
max_connections = 1000
wait_timeout = 5
修改後重啟 MySQL。若頻繁發生,請檢查應用程式連線池設定、是否正確釋放連線。