how to run command "mysqladmin flush-hosts" on Amazon RDS database Server instance?

MysqlAmazon Rds

Mysql Problem Overview


I got a database server failure, says host is blocked because of many connection errors. It ask me to unblock with 'mysqladmin flush-hosts'

how and where should I run this command to our amazon rds database server?

thank you

Mysql Solutions


Solution 1 - Mysql

For normal MySQL, just connect as the 'root' administrative super user, and issue the command:

FLUSH HOSTS

Even in the case of too many connections, MySQL should be keeping a connection in reserve so that a super user can connect.

The mysqladmin client generally connects as root anyway and issues the above SQL.

Solution 2 - Mysql

Login to any other EC2 instance you have that has access to the RDS instance in question and has mysqladmin installed and run

mysqladmin -h <RDS ENDPOINT URL> -P 3306 -u <USER> -p flush-hosts

you will be prompted for your password

Solution 3 - Mysql

When an Amazon RDS instance is blocked because the value of max_connect_errors has been exceeded, you cannot use the host that generated the connection errors to issue the "flush hosts" command, as the MySQL Server running on the instance is at that point blocking connections from that host.

You therefore need to issue the "flush hosts" command from another EC2 instance or remote server that has access to that RDS instance.

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

If this involved launching a new instance, or creating/modifying security groups to permit external access, it may be quicker to simply login to the RDS user interface and reboot the RDS instance that is blocked.

Solution 4 - Mysql

I fixed this error on my RDS instance by rebooting it from the AWS management console. HTH

[edit: lol downvotes]

Solution 5 - Mysql

On Amazon RDS FLUSH HOSTS; can be executed from default user ("Master Username" in RDS info), and it helps.

Solution 6 - Mysql

Since the hosts is blocked. try connect it from other host and execute the mysqladmin flush-hosts command.

mysqladmin -h <RDS ENDPOINT URL> -P <PORT> -u <USER> -p flush-hosts

Solution 7 - Mysql

You will have to connect your RDS through a computer which as mysql installed on it I used one of my hosting VPS using SSH

After i was logged in my VPS ( i used putty ) It was simple, in the prompt i entered the following command:

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

Solution 8 - Mysql

You can restart the database on RDS Admin.

Solution 9 - Mysql

You can flush hosts local MySQL using following command:

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

or

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

Though Amazon RDS database server is on network then use the following command as like as flush network MySQL server:

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 

In additional suggestion you can permanently solve blocked of many connections error 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";

Solution 10 - Mysql

got this error today on a customer rds while they were using Heidi Sql client.

We simply used 'mysqlroot' on the ec2 that talks to the rds in question to connect, followed by issuing the 'flush hosts;' cmd.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser955461View Question on Stackoverflow
Solution 1 - MysqlbarryhunterView Answer on Stackoverflow
Solution 2 - MysqlChrisView Answer on Stackoverflow
Solution 3 - MysqlGarreth McDaidView Answer on Stackoverflow
Solution 4 - MysqlAlex WView Answer on Stackoverflow
Solution 5 - MysqlAtis LezdinsView Answer on Stackoverflow
Solution 6 - MysqlRyanView Answer on Stackoverflow
Solution 7 - MysqlRam m.View Answer on Stackoverflow
Solution 8 - MysqlScudellettiView Answer on Stackoverflow
Solution 9 - MysqlSyeful IslamView Answer on Stackoverflow
Solution 10 - MysqlmcgriddletimeView Answer on Stackoverflow