Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When I use incorrect password to connect to mysql server, and the test count is over the max_connect_errors, and I find the Aborted_connects is also arise as the count I test, but the host is still not blocked.

So does the Aborted_connects over the max_connect_errors then host_name is blocked?

share|improve this question
    
This gets a +1 becasue so many people encountered this and the solution is a FLUSHS HOSTS away. Let this question serve as a good reminder in this matter !!! –  RolandoMySQLDBA Aug 31 '11 at 12:39
    
i have same problem too.., first i think this is caused by max_connection but it will send too many connection not many connection error.., i just stressing with jmeter with huge connection to develserver but didn't show any error message similar to many connection errors. –  user10295 Jul 21 '12 at 3:39
    
@newbie with new questions, we encourage you to ask your own question, even if it seems this solution works for you. The ask-question button is on the top right of the page :D –  jcolebrand Jul 21 '12 at 8:50
    
"So does the Aborted_connects over the max_connect_errors then host_name is blocked?" - also interested in the answer to this one. From my testing, it does NOT look like aborted_connects is compared against max_connect_errors - but that seems strange –  Nikita Nov 14 '12 at 18:58
add comment

2 Answers

At this point, you may need to run FLUSH HOSTS and see if this unblocks.

The MySQL Documentation says this about FLUSH HOSTS:

  • Empties the host cache tables. You should flush the host tables if some of your hosts change IP address or if you get the error message Host 'host_name' is blocked. When more than max_connect_errors errors occur successively for a given host while connecting to the MySQL server, MySQL assumes that something is wrong and blocks the host from further connection requests. Flushing the host tables enables further connection attempts from the host. See Section C.5.2.6, “Host 'host_name' is blocked”. You can start mysqld with --max_connect_errors=999999999 to avoid this error message.

Why should a host get blocked to begin with ??

According to the MySQL Documentation:

If you get the following error, it means that mysqld has received many connect requests from the host 'host_name' that have been interrupted in the middle: Host 'host_name' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts' The number of interrupted connect requests permitted is determined by the value of the max_connect_errors system variable. After max_connect_errors failed requests, mysqld assumes that something is wrong (for example, that someone is trying to break in), and blocks the host from further connections until you execute a mysqladmin flush-hosts command or issue a FLUSH HOSTS statement. See Section 5.1.3, “Server System Variables”.

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

shell> mysqld_safe --max_connect_errors=10000 &

If you get this error message for a given host, you should first verify that there isn't anything wrong with TCP/IP connections from that host. If you are having network problems, it does you no good to increase the value of the max_connect_errors variable.

share|improve this answer
1  
I think he's asking how a host gets blocked. The manual doesn't seem to reflect it. I've tried connecting to a remote dev db using incorrect users, incorrect passwords. max_connect_errors = 5 and every time, aborted_connects increases, but without flushing hosts, the next valid attempt I make works. The manual suggests it shouldn't. –  Derek Downey Aug 31 '11 at 12:41
    
Thanks @DTest. Question context was why it happens, not how to fix. –  RolandoMySQLDBA Aug 31 '11 at 14:54
    
All the documentation says is "connect requests … that have been interrupted in the middle". To me it's not really clear whether it means only before logging in, or errors later may also trigger it. –  Jan Hudec Feb 27 at 13:04
    
@JanHudec Connection requests are connection attempts that fail or succeed authentication. That is separate and distinct from an aborted connection that had an earlier success in establishing the connection/session. Therefore, the phrase "interrupted in the middle" is very accurate and correctly expressed in the MySQL Documentation. –  RolandoMySQLDBA Feb 27 at 14:14
add comment

One cause of such a blockage is where some random person on the host decides to do some monitoring of MySQL and sets up a telnet to the MySQL port on the remote server. With a sufficient number of telnet invocations, the host is then blocked from further access to that MySQL server. Unlike some servers, MySQL does not automatically unblock access after a reasonable amount of time: the server administrator has to knock MySQL on the head.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.