环境

Linux、MySQL 5.5

报错

Host ‘hostname’ is blocked because of many connection errors; unblock with 'mysqladmi.

原因

该host上部署的服务因数据库帐号配置错误,导致短时间内连接MySQL服务失败次数超过max_connection_errors参数设定值(默认10),从而被拒绝。

解决方法

方法一:

刷新记录报错host的文件

mysqladmin  -uroot -p  -h192.168.1.1 flush-hosts

mysql>flush hosts;

注意:数据库主从服务器要确定是被哪个MySQL服务拒绝了,刷新对应的服务器即可,不确定的话就都刷新吧。

方法二:

进入数据库将max_connection_errors参数调高,也可以在my.cnf文件中修改不过需要重启MySQL。

mysql>show variables like '%max_connection_errors%';

mysql>set global max_connect_errors = 1000;

mysql>show variables like '%max_connection_errors%';

相关文章:

  • 2021-05-18
  • 2021-11-07
  • 2022-12-23
  • 2021-04-04
  • 2021-05-16
  • 2022-12-23
  • 2022-02-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
相关资源
相似解决方案