Host 'xxxxxx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

os: centos 7.4
db: mysql 8.0

登錄 mysql 服務端口是,提示如下錯誤:

# telnet 192.168.56.60 3306
Trying 192.168.56.60...
Connected to 192.168.56.60.
Escape character is '^]'.
kHost '192.168.56.61' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host.

提示在 目標mysql 主機上執行如下命令,然後就可以連了。

# mysqladmin flush-hosts

官網查了下是受 max_connect_errors 的影響

mysql> show global variables like '%max_connect_errors%';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_connect_errors | 100   |
+--------------------+-------+
1 row in set (0.01 sec)

調大這個值

SET GLOBAL max_connect_errors=10000;

同時修改參數文件

[mysqld]
max_connect_errors=10000

參考:
https://dev.mysql.com/doc/refman/8.0/en/blocked-host.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章