Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unblock with mysqladmin flush hosts

I have gone through similar cases listed here but it doesn't seem to work.

I was using MySQL Workbench to establish a connection with my database which is hosted on another server. Tried a few times and unable to connect followed by this error. I am confused as to where I should even do this flush. On PhpMyadmin under the SQL query? Cos when I tried to input the following command, it returns as syntax error. I am using a windows OS thus no shell shell scripting for me to input this information either. I am accessing the database temporarily via Cpanel/ phpmyadmin now.

Please help to tell where I should input this data and if my syntax is wrong. Thanks for help.

mysqladmin flush-hosts;  or  mysqladmin -umyname -pmypassword flush-hosts; 

My error message as follows:

Failed to connect to MYSql at 192...* with user myName

Host 'host-92...*.as13285.net' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

like image 726
kar Avatar asked Mar 09 '14 17:03

kar


People also ask

What does Mysqladmin flush hosts do?

In the case of FLUSH HOSTS; , MySQL will empty the host cache, which effectively means MySQL's record of which hosts are currently or have recently connected is reset, allowing for further connections from said hosts.

Is blocked because of many connection errors unblock with Mysqladmin flush hosts at?

Host is blocked because of many connection errors. Unblock with mysqladmin flush hosts" is a database side error and occurs due to multiple connections created while connecting the database. To resolve the above error, you need to execute "Flush hosts " command.

How do I run flush privileges?

Actually, we need to perform flush-privileges operation to tell the server to reload the grant tables. This can be done by issuing FLUSH PRIVILEGES statement or by executing a mysqladmin flush-privileges or mysqladmin reload command.

Is blocked because of many connections?

That error means mysqld has received many interrupted connection requests from the given host. And the number exceeds the value of the max_connect_errors system variable. For example, the current max_connect_errors value is 10.


2 Answers

mysqladmin is not a SQL statement. It's a little helper utility program you'll find on your MySQL server... and "flush-hosts" is one of the things it can do. ("status" and "shutdown" are a couple of other things that come to mind).

You type that command from a shell prompt.

Alternately, from your query browser (such as phpMyAdmin), the SQL statement you're looking for is simply this:

FLUSH HOSTS; 

http://dev.mysql.com/doc/refman/5.6/en/flush.html

http://dev.mysql.com/doc/refman/5.6/en/mysqladmin.html

like image 173
Michael - sqlbot Avatar answered Sep 19 '22 21:09

Michael - sqlbot


You should put it into command line in windows.

mysqladmin -u [username] -p flush-hosts **** [MySQL password] 

or

mysqladmin flush-hosts -u [username] -p **** [MySQL password] 

For network login use the following command:

mysqladmin -h <RDS ENDPOINT URL> -P <PORT> -u <USER> -p flush-hosts mysqladmin -h [YOUR RDS END POINT URL] -P 3306 -u [DB USER] -p flush-hosts  

you can permanently solution your problem by editing my.ini file[Mysql configuration file] change variables max_connections = 10000;

or

login into MySQL using command line -

mysql -u [username] -p **** [MySQL password] 

put the below command into MySQL window

SET GLOBAL max_connect_errors=10000; set global max_connections = 200; 

check veritable using command-

show variables like "max_connections"; show variables like "max_connect_errors"; 
like image 26
Syeful Islam Avatar answered Sep 21 '22 21:09

Syeful Islam