异常现象:
(1129, "Host '192.168.1.61' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'")
异常原因:
同一个ip在短时间内产生太多(超过mysql数据库max_connection_errors的最大值)中断的数据库连接而导致的阻塞;
解决方案:
- 方案1.提高允许的max_connection_errors数量。
show variables like '%max_connection_errors%';
set global max_connect_errors = 1000;
或者在my.cnf中配置
max_connect_errors = 1000
- 方案2.重置错误记录数。
mysql> flush hosts;