天天看點

navicat用戶端連接配接mysql資料庫報錯

給開發同僚建立一mysql使用者用于查詢 剛開始使用沒問題 過了一會報錯如下

Host 'xxxx'is blocked because of many connection errors: unblock with 'mysqladmin flush-hosts'

查了一下資料 原因:這說明mysqld已經得到了大量(max_connect_errors)的主機'hostname'的在中途被中斷了的連接配接請求。在 max_connect_errors次失敗請求後,mysqld認定出錯了(象來字一個***的***),并且阻止該站點進一步的連接配接,直到某人執行指令 mysqladmin flush-hosts。

解決方法在mysql資料庫伺服器上執行

[[email protected] nrpe-2.8.1]# mysqladmin flush-hosts -uroot -p

Enter password:

mysql> show variables like "max_connect_errors";

+--------------------+-------+

| Variable_name      | Value |

+--------------------+-------+

| max_connect_errors | 10    |

+--------------------+-------+

1 row in set (0.00 sec)

mysql> set global max_connect_errors=100;

Query OK, 0 rows affected (0.00 sec)

mysql> show variables like "max_connect_errors";

+--------------------+-------+

| Variable_name      | Value |

+--------------------+-------+

| max_connect_errors | 100   |

+--------------------+-------+

轉載于:https://blog.51cto.com/liveforlinux/801146