MySql Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts…

environment: linux, mysql5.5.21

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;

(3) 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 under which directory mysqladmin can be found: Where is mysqladmin )

(1) use the command to modify in the found Directory: 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 performed in the database. The command is as follows: flush hosts

Similar Posts: