业务库从mysql5.7.39 升级到 mysql5.7.43 中,JDBC业务连接报错,报错内容 ERROR 1129 (HY000): Host '192.168.1.34' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
同一个ip在短时间内产生太多,中断的数据库连接而导致的阻塞
进入Mysql数据库查看max_connect_errors:
show variables like '%max_connect_errors%';
100
修改max_connect_errors的值
set global max_connect_errors = 1000;
查看是否修改成功
show variables like '%max_connect_errors%';
1000
mysqladmin -u xxx -p flush-hosts
或者
mysql -uroot -p
> flush hosts;
重启会立即释放
vim /etc/my.cnf
max_connect_errors = 1000