Home

MySQL连接次数过多报错

MySQL 连接报错

“Host ‘10.7.30.133’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’”

解决方法

增加最大错误连接数

mysql> use mysql;
# 查看最大错误连接数
mysql> show variables like '%max_connect_errors%'
# 修改最大错误连接数
mysql> set global max_connect_errors = 1000;
# 查看修改结果
mysql> show variables like '%max_connect_errors%'

重置计数器

mysql> flush hosts;

或者

$ mysqladmin flush-hosts