null, message from server: "Host 'xxx' is blocked because of many connection errors; unblock


Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’ 解決方法
環境:centos7,mysql8

錯誤:Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’

原因:

  同一個ip在短時間內產生太多(超過mysql數據庫max_connection_errors的最大值)中斷的數據庫連接而導致的阻塞;

解決方法:

1、提高max_connection_errors數量:

  (1)、臨時解決(重啟后恢復):修改max_connection_errors的數量為1000: set global max_connect_errors=1000;
     查看是否修改成功:SHOW GLOBAL VARIABLES LIKE ‘%max_connect_errors%’;

  (1)、永久修復:修改my.ini中max_connection_errors=1000。重啟服務永久生效

 

2、使用mysqladmin flush-hosts 命令清理一下hosts文件(臨時應急處理);
   mysqladmin flush-hosts -h iphost -P port -u root -prootpasswd;
  備注:
也可以mysql -uroot -prootpasswd 在數據庫中執行命令:flush hosts;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM