Host XXX is blocked because of many connection errors, unblock with ' mysqladmin flush-hosts

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.