mysql运维

1、“Host 'XXX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'”

同一个IP连接失败次数超过了最大的max_connection_errors,就会阻止连接

max_connect_errors是一个MySQL中与安全有关的计数器值,它负责阻止过多尝试失败的客户端以防止暴力破解密码的情况。

如果希望重置此计数器的值,则必须重启MySQL服务器或者执行mysql> flush hosts; 命令。当这一客户端成功连接一次MySQL服务器后,针对此客户端的max_connect_errors会清零。

#查看参数大小

show variables like 'max_connect_errors';

#运行以下命令查看被封锁的主机列表:

SELECT * FROM performance_schema.host_cache;

posted on 2025-07-16 09:14  chengxuyuan123  阅读(35)  评论(0)    收藏  举报