错误:
1129 - HOST 'ip' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
原因:
同一IP在短时间内产生过多的中断连接导致阻塞。
解决方法:
第一种:提高允许的max_connection_errors数量
(1) 进入Mysql数据库查看max_connection_errors
show variables like '%max_connection_errors%';
(2) 加大max_connection_errors值
set global max_connect_errors = 1000;
(3) 再次查看max_connection_errors
show variables like '%max_connection_errors%';
也可以通过配置文件my.cnf修改,添加参数 max_connection_errors=1000
第二种:清理hosts文件
使用mysqladmin命令清理hosts文件,在命令行下执行如下指令
mysqladmin flush-hosts -h[IP] -P[Port] -u[USER] -p;
注释:
如果不知道mysqladmin在哪个目录下,可以通过where mysqladmin查找。
IP,端口,用户名可以根据自己需求进行修改。