MySQL – java.sql.SQLException: null, message from server: “Host ‘example.com’ is blocked because of many connection errors

You will find this error in MySQL error log and this occurs due to many failed connections to MySQL possibly via an application. When more than ‘max_connect errors’ occurs for a host successively, MySQL assumes that something is wrong and blocks further connections to the server. At this point you will not be able to access or connect to MySQL server.

To fix this error you need to flush MySQL host cache.

Login to the server and in terminal run below given command.

# mysqladmin flush-hosts

This will empty host cache to allow further connections to the server, so now you have access to MySQL server, from here on don’t forget to enter correct credentials.

Besides this you can also raise ‘max_connect_errors’ from default 10 to a large value as an additional step.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts