I was helping my friend to fix MySQL error. He is frequently receiving following error when connecting to MySQL server:
Host ‘hostname’ is blocked because of many connection errors.
Unblock with ‘mysqladmin flush-hosts’
Running mysqladmin flush-hosts fixes the error but how can we get rid of this error permanently?
This is due to max_connect_errors limit. By default this limit is set to 10. That means, if there is more than 10 error from your system, your host will be blocked to access MySQL. You can either check why there is failed login or errors or you can raise the limit for max_connect_errors variable.
To increase the value, you just need to add/edit max_connect_errors variables in your MySQL configuration file and then restart MySQL service. You can set higher limit as per your need.