"Host is blocked because of many connection errors"解決方法
環境:
linux,mysql5.5
錯誤:Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'mysql 緣由:linux 同一個ip在短期內產生太多(超過mysql數據庫max_connection_errors的最大值)中斷的數據庫鏈接而致使的阻塞;sql 解決方法:數據庫 一、提升容許的max_connection_errors數量(治標不治本):ide ① 進入Mysql數據庫查看max_connection_errors: show variables like '%max_connection_errors%';url ② 修改max_connection_errors的數量爲1000: set global max_connect_errors = 1000;spa ③ 查看是否修改爲功:show variables like '%max_connection_errors%';blog 二、使用mysqladmin flush-hosts 命令清理一下hosts文件(不知道mysqladmin在哪一個目錄下能夠使用命令查找:whereis mysqladmin);ip ① 在查找到的目錄下使用命令修改:/usr/bin/mysqladmin flush-hosts -h192.168.1.1 -P3308 -uroot -prootpwd;ci 備註: 其中端口號,用戶名,密碼均可以根據須要來添加和修改; 配置有master/slave主從數據庫的要把主庫和從庫都修改一遍的(我就吃了這個虧明明很容易的幾條命令結果折騰了大半天); 第二步也能夠在數據庫中進行,命令以下:flush hosts; |