Article ID: 2379, created on Oct 29, 2007, last review on May 11, 2014

  • Applies to:
  • Pro Control Panel Linux

AdditionalInformation

View Knowledge
Knowledge ID 1136
Product : WEBppliance for Linux
Version : 3.5.18
Topic : FAQ

Title
Connection to mysql fails with Error "Host 'localhost.localdomain' is blocked

Summary
Connection to mysql fails with Error "Host 'localhost.localdomain' is blocked because of many connection errors."

Prevention


Details
Solution:

Running "mysqladmin -p flush-hosts" as root should clear this problem.

For details of this problem refer to the following URL ..
http://www.mysql.com/doc/en/Blocked_host.html

This is more of a mysql feature to protect against attacks. But a default limit of 10 for max_connect_errors can some times be a problem.

This situation could arise if there is a script  under some domain on your server, which is consistently trying to connect to the mysql database using invalid login information.

We would suggest that you increase the max_connect_errors, in steps of 50 starting with 250, and observe if this problem decreases or is eliminated.

You will need to add the following in /etc/my.cnf under section [mysqld] set-variable=max_connect_errors=250

And then restart mysql using the following command:
service mysqld restart

Please note, we have not yet tested the impact of this option, if you face any problems, please remove it. Though there should be no issue setting this mysql variable (max_connect_errors) to a reasonably higher value than the default of 10.

You may also want to create a cron job to periodically run 'mysqladmin flush-hosts'.


Attachments


Related Knowledge

Related Links
 
Last ModifiedUsageSatisfiedLast Used
8/20/2004 12:56:51 PM36 10/11/2007 6:14:33 AM

4cc899da08664637a8bc437308d3ddd7 3ccb419cf98083f3bb45808fba8dbc7c 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF