MySQL host is blocked because of your connection errors; unblock with 'mysqladmin flush-hosts &

Source: Internet
Author: User
Tags mysql host

From: http://www.cnblogs.com/susuyu/archive/2013/05/28/3104249.html

Environment:Linux, mysql5.5.21

Error:Host is blocked because of your connection errors; unblock with 'mysqladmin flush-hosts'

Cause:

The same IP address causes too many database connections (exceeding the maximum value of the MySQL database max_connection_errors) in a short period of time;

Solution:

1. Increase the number of max_connection_errors allowed (temporary ):

① Go to the MySQL database to view max_connection_errors:Show variables like '% max_connection_errors % ';

② Modify max_connection_errors to 1000:
Set global max_connect_errors = 1000;

③ Check whether the modification is successful:Show variables like '% max_connection_errors % ';

2. UseMysqladmin flush-hostsRun the following command to clear the hosts file:Whereis mysqladmin);

① Use the command to modify the Directory:/usr/bin/Mysqladmin flush-hosts-h192.168.1.1-P3308
-Uroot-Prootpwd;

Note:

You can add and modify the port number, user name, and password as needed;

If the Master/Slave database is configured, you must modify both the master database and slave database. (I have suffered this loss. It is easy to get a few command results that have been tossing for a long time );

The second step can also be performed in the database. The command is as follows:Flush hosts;

Related Article

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.