Host 'X' Blocked due to many connection errors

Hi, I am using Java with MySql. I took some hosting services x, in that I deployed my Java .war file, it works for several days, since after 2 days I get some error that

java.sql.SQLException: null, message from the server: "Host" X-host "is blocked due to many connection errors, unlock" mysqladmin flush-hosts ".

I used a regular database connection as well as a connection pool.

My code is:

Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://IP Address:3306/DBName?user=xxxxx&password=YYYYYYY");

..

Please give a decision ..

+5
source share
2 answers

Unlocking the host using mysqladmin flush-hosts Or increasing the max_connect_errors parameter will solve the problem.

server start:

shell> mysqld_safe --max_connect_errors=10000 &

Runtime:

mysql> SET GLOBAL max_connect_errors=10000;

.  * MySQL.err  * TCP/IP

: http://dev.mysql.com/doc/refman/5.0/en/blocked-host.html http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_connect_errors

+5

mysql.

$ sudo service mysql restart

, ,

$ mysql> SET GLOBAL max_connections = 500;
$ mysql> SET GLOBAL max_connect_errors=10000;

, my.cnf

$ vi /etc/mysql/my.cnf

, !

0

All Articles