Environment: linux, mysql5.5.21
错误:Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
reason:
Blockage caused by too many (more than the maximum value of mysql database max_connection_errors) interrupted database connections for the same ip in a short period of time;
Solution:
1. Increase the number of max_connection_errors allowed (to cure the symptoms but not the root cause):
① Enter the Mysql database to view max_connection_errors: show variables like '%max_connection_errors%';
② Modify the number of max_connection_errors to 1000: set global max_connect_errors = 1000;
③ Check whether the modification is successful: show variables like '%max_connection_errors%';
2. Use the mysqladmin flush-hosts command to clean up the hosts file (I don't know which directory mysqladmin is in, you can use the command to find: whereis mysqladmin );
① Use the command to modify in the found directory: /usr/bin/ mysqladmin flush-hosts -h192.168.1.1 -P3308 -uroot -prootpwd;
Remark:
The port number, user name, and password can be added and modified as needed;
If the master/slave master-slave database is configured, both the master library and the slave library should be modified again (I just ate the result of a few commands that were obviously easy to toss for most of the day);
The second step can also be carried out in the database, the command is as follows: flush hosts;
This article comes from: http://www.cnblogs.com/susuyu/archive/2013/05/28/3104249.html
Do it yourself steps:
1. Remotely connect to the host where the database is located ssh [email protected]
2. Enter the password qw365qb666
3. Enter the directory cd /usr/bin
4. Connect to the database mysql -uroot -p111111
5. Execute the command flush hosts;
or /usr/bin/mysqladmin flush-hosts -h192.168.7.188 -P3306 -uroot -p111111