MySql Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’ [How to Solve]

 

It’s the end of the year, it’s the middle of the night on Friday, and the disaster is not alone. After repairing redis, MySQL doesn’t stop

Error: host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’

Reason:

The same IP generates too much in a short time (more than MySQL database)_ connection_ The maximum value of errors) caused by the interrupted database connection

Solution:

1. Increase allowed Max_ connection_ Number of errors

Enter MySQL database to view Max_ connection_ errors: show variables like ‘%max_ connection_ errors%’;

Modify Max_ connection_ The number of errors is 1000: set global max_ connect_ errors = 1000;

Check whether the modification is successful: Show variables like% max_ connection_ errors%’;

2. Use the command mysqladmin flush hosts to clean up the hosts file (I don’t know which directory mysqladmin is in, I can use the command to find: where is mysqladmin)

In the found directory, use the command to modify/usr/bin/mysqladmin flush hosts – h192.168.1.1 – p3308 – uroot – prootpwd

Remarks:

Port number, user name and password can be added and modified as needed

If the master/slave database is configured, it is necessary to modify both the master and slave databases (I just suffered from some very easy commands, and it took me a long time)

The second step can also be done in the database. The command is as follows: flush hosts

Similar Posts: