“Host is blocked because of many connection errors”问题解决

环境mysql

Linux、MySQL 5.5sql

报错数据库

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

缘由服务器

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

解决方法spa

方法一:code

刷新记录报错host的文件部署

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

it

mysql>flush hosts;io

注意:数据库主从服务器要肯定是被哪一个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%';
相关文章
相关标签/搜索