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