Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why MySQL connection is blocked of many connection errors?

Tags:

As you can see I have a problem on a database connection. It gives me this error:

...is blocked because of many connection errors

I searched some answers but I couldn't solve my problem.

I don't know if I gave all the information that you need, so if you need something else, just tell me. I have a database connection from different computers and I had a user created to access the database but it had % in the hosts row, so I wanted to change it with an IP address for security issues and it gave me this error so now I'm stuck.

like image 613
Nick Avatar asked Nov 16 '13 04:11

Nick


People also ask

Is blocked because of many connection errors unblock with Mysqladmin?

Host is blocked because of many connection errors. Unblock with mysqladmin flush hosts" is a database side error and occurs due to multiple connections created while connecting the database. To resolve the above error, you need to execute "Flush hosts " command. You can execute the command as per below syntax.

What causes MySQL too many connections?

The MySQL “Too many connections” error occurs when more queries are sent to a MySQL database than can be processed. The error can be fixed by setting a new number of maximum connections in the configuration file or globally.

How many MySQL connections can handle?

Simultaneous MySQL connection limits Each database user is limited to 38 simultaneous MySQL connections. This limitation helps to prevent overloading the MySQL server to the detriment of other sites hosted on the server.


1 Answers

MySQL blocks clients which error made while connecting to protect MySQL from malformed client.

So first, you need to find what sort of error is....

You might check MySQL error log in data directory. (typically hostname.err)

Or, you can increase max_connect_errors (what is current value?) maximum value depends on architecture. on 32 bit, 4294967295. 18446744073709547520 for 64 bit. (Manual)

mysql> SET GLOBAL max_connect_errors = 100000000; 

But this is not real solution if error is frequently occurred.

FLUSH HOSTS can help you to eliminate blocked host right now.

mysql> FLUSH HOSTS; 

If want to run from outside mysql console then use mysqladmin command:

# mysqladmin flush-hosts 
like image 156
Jason Heo Avatar answered Sep 22 '22 18:09

Jason Heo