解决:mysql is blocked because of many connection errors;问题

环境:centos 6.5,mysql 5.6.19

问题:

在用telnet l0.0.1.120 3306数据库时,报错

kHost 'l0.0.1.120' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'Connection closed by foreign host.


原因:是同一IP的connection errors超出默认的最大值了。

解决方法1:

重启mysql服务即可。

解决方法2:

通过命令行进行mysql控制台

flush hosts;


解决方法3:

修改默认的max_connect_errors连接数(mysql 5.6以上默认是100)

显示默认连接数:show variables like '%max_connect_errors%';

修改连接数为500:set global max_connect_errors = 500; (基本上同一IP不可能超过500)

flush privileges;

service mysql restart



你可能感兴趣的:(service,closed,errors,foreign,because)