mysql报错"Host '1' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

今天在升级系统时,连接mysql时报错了,查看错误日志显示如下:

 Caused by: java.sql.SQLException: null,  message from server: "Host '1' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"
 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) [mysql-connector-java-5.0.4-bin.jar:na]
 at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997) [mysql-connector-java-5.0.4-bin.jar:na]
 at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670) [mysql-connector-java-5.0.4-bin.jar:na]
 at com.mysql.jdbc.Connection.(Connection.java:1531) [mysql-connector-java-5.0.4-bin.jar:na]
 at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) [mysql-connector-java-5.0.4-bin.jar:na]
 at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) [commons-dbcp-1.2.2.jar:1.2.2]
 at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) [commons-dbcp-1.2.2.jar:1.2.2]
 at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247) [commons-dbcp-1.2.2.jar:1.2.2]
 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221) [commons-dbcp-1.2.2.jar:1.2.2]
 ... 52 common frames omitted

问题分析:

  根据提示是因为连接数过多导致许多错误的连接,但是在测试时,在本机通过 mysql -uroot  -proot  -h  192.168.1.2登录,系统会提示无权限需要密码之类的错误,在其他主机192.168.1.3上mysql -uroot  -proot  -h  192.168.1.2登录成功,个人很奇怪,现在还没找到原因

解决办法

 重启mysql,就OK了

 

 

你可能感兴趣的:(mysql)