Connection MySQL failed, in addition to the permissions issue, also encountered this situation, error message:Host XXX is blocked because of many connection errors, unblock with ' mysqladmin FL Ush-hosts '. and XXX is not the IP address but domain name. The MySQL server and the client are on the same test and the Mysql-u root-h ipaddr is used when connecting.
View the hosts configuration of the machine, there is a domain name mapped to the native address, but there are changes, the old has been looked at, but the error message shows that the host name is a commented out result, should be related to the cache.
Cause: The MySQL server has received a large number of terminated connections from a host, and decided to terminate the connection from the host, allowing the maximum number of connection errors to be max_connect_errors, which can be queried by the show variables command. It is generally 10.
The reason for domain name instead of IP is that the MySQL server will make DNS resolve to the client when it receives the connection, and the result will be mysqld cached, if only the IP connection is used. You can add the-skip-name-resolve parameter (command line or MY.CNF) when you start mysqld.
Workaround: Execute mysqladmin flush-host in another place or log in to MySQL to execute the flush hosts (the native host is not allowed to log on!). )。
This article from "the more efforts, the more fortunate!" "Blog, be sure to keep this provenance http://7250365.blog.51cto.com/7240365/1558205
Host XXX is blocked because of many connection errors, unblock with ' mysqladmin flush-hosts