Search the MySQL manual:

A.2.5 Host '...' is blocked Error

If you get an error like this:

Host 'hostname' is blocked because of many connection errors.
Unblock with 'mysqladmin flush-hosts'

this means that mysqld has gotten a lot (max_connect_errors) of connect requests from the host 'hostname' that have been interrupted in the middle. After max_connect_errors failed requests, mysqld assumes that something is wrong (like an attack from a cracker), and blocks the site from further connections until someone executes the command mysqladmin flush-hosts.

By default, mysqld blocks a host after 10 connection errors. You can easily adjust this by starting the server like this:

shell> mysqld_safe -O max_connect_errors=10000 &

Note that if you get this error message for a given host, you should first check that there isn't anything wrong with TCP/IP connections from that host. If your TCP/IP connections aren't working, it won't do you any good to increase the value of the max_connect_errors variable!

User Comments

Posted by [name withheld] on Saturday July 13 2002, @7:26am[Delete] [Edit]

One cause of the two many connection problem
is that when a connection is made to the server
the connection/process by default is in sleep mode
for 8 14400 (sec) -
this can be changed in etc/my.cnf
the variable are

set-variable = interactive_timeout=14400
set-variable = wait_timeout=14400

Posted by [name withheld] on Thursday July 4 2002, @3:02am[Delete] [Edit]

This problem is a bit strange. My max connections
var is 250 yet i experianced this problem with
less than 100 simultaneous users. There is
definitelly something wrong with this ...
Strangely enough when configured apache with no
keepalive connections and max spare servers to 20
(from 50) the problem stopped. Yes ! i know that
in theory there is no connection of what i did
with the problem but hey it might help somebody !
The mysql team should REALLY look into this
problem btw. --- John Loukeris <ououou@grafistas.gr>

Posted by [name withheld] on Thursday July 4 2002, @3:01am[Delete] [Edit]

This problem is a bit strange. My max connections
var is 250 yet i experianced this problem with
less than 100 simultaneous users. There is
definitelly something wrong with this ...
Strangely enough when configured apache with no
keepalive connections and max spare servers to 20
(from 50) the problem stopped. Yes ! i know that
in theory there is no connection of what i did
with the problem but hey it might help somebody !
The mysql team should REALLY look into this
problem btw. --- John Loukeris <ououou@grafistas.gr>

Posted by Okan Cimen on Friday May 17 2002, @6:24am[Delete] [Edit]

I am running 3.23.49-nt on Win2K advanced server
w/ 2GB of RAM. When I set max_connections
parameter to 1000, connection time takes too
much. Keep it as low as you can

Posted by James Smith on Friday May 17 2002, @6:24am[Delete] [Edit]

this problem is big, very big, and seems to be
brushed over with a 'this means you have max
connections' when in the real world most
complaints refer too 'I have few visiors' this is
a massive bug in mysql which will eventually
render it useless..sorry

Posted by MySql DingBat on Saturday November 2 2002, @3:53pm[Delete] [Edit]

Error 1130

1130 - Host '11.111.111.111' is not allowed to
connect to this MySQL server

The reference 11.111.111.111 is where your
machines IP address would be located.

I have found this error while trying to connect to
MySql using a remote administration tool. I was able
to connect perfectly until today. I can no longer
access the MySql Server. Is there some limit on how
many times one can make an attempt to the server
before the server is blocked. I know my hostname
and user and password are all correct.

It is running on Windows 2000 Advanced Server.

If there is a limit please let me know. I have tried
everything even tried resetting the root password
and no luck there either. If there is a sure fire way of
resetting the entire MySql Server please let me
know. I have shut down and reinstalled it as a
service and that didn't work either , however it ran
fine as a dervice before today.

This error 1130 is apparently one that doesn't
happen often as I cannot find any references on how
to resolve it. If anyone knows how to resolve this let
me know. You may email me jasonr1@dtccom.net

Thanks

Add your own comment.