短時間內單用戶產生大量的中斷數據庫鏈接,會導致單用戶數據庫鏈接超過上限,禁止訪問,需要清理數據庫緩存
命令1:
mysqladmin -u root -p flush-hosts
接着輸入密碼即可
命令2:
mysql -uroot -p*****
登錄進MySQL系統
輸入 flush hosts; 清除緩存(別忘記命令后的分號;)
命令3:
mysqladmin -uroot -p***** flush-hosts
一條命令搞定,但是系統會彈出waring提示,不建議這樣連帶着密碼執行命令
mysqladmin:[Warning] Using a password on the command line interface can be insecure.
命令4:
也可以在重啟之前,在配置文件中將該參數調大。
vim /etc/my.cnf
max_connect_errors = 100
搞定!