# 应用连MySQL 报错ERROR 1129 Host is blocked because of many connection errors > 开发反馈应用连MySQL报错 create connection SQLException, url: 连接串, errorCode 1129。搜索 1129报错,报错内容为:Host is blocked because of many connection errors ### 一、 报错原因 同一个ip在短时间内产生太多中断的数据库连接(超过mysql数据库max_connection_errors设置),导致被阻塞。 ### 二、 解决方法 首先还是要找到产生中断数据库连接的原因,如果不修复,下面的方法只是治标不治本而已。 ### 方法1:提高允许的max_connection_errors数量 查看max_connection_errors,默认为10 ```bash show variables like '%max_connection_errors%'; ``` 主从库修改max_connection_errors的数量为1000(立即生效) ```bash set global max_connect_errors = 1000; ``` 主从库在my.cnf中[mysqld]下添加(重启后不失效) ```bash max_connect_errors = 1000 ``` ### 方法2:重置错误记录数 ```bash mysqladmin flush-hosts -h 127.0.0.1 -uroot -p ``` ### 方法3:重置错误记录数 root登陆后 ```bash mysql -u root -p flush hosts; ``` ### 参考 - [MySQL连接的时候报 ERROR 1129 - 简书](https://www.jianshu.com/p/0fbbc251a0c2 "MySQL连接的时候报 ERROR 1129 - 简书") - [mysql连接flush-hosts问题处理_刘欢的博客-CSDN博客_flush hosts](https://blog.csdn.net/github_38851471/article/details/86678286 "mysql连接flush-hosts问题处理_刘欢的博客-CSDN博客_flush hosts")