How to run the mysqladmin flush-hosts command based on Amazon RDS Server?

I got a database server error, says the host is blocked due to many connection errors. He asks me to unlock "mysqladmin flush-hosts"

how and where should this command be run on our amazon rds database server?

Thank you

+55
mysql amazon-rds
Nov 04 '11 at 18:52
source share
9 answers

I do not use RDS, but with normal mysql I just connect to the root user. Then do

FLUSH HOSTS; 

sql query.

Even if there are too many connections, mysql must support a backup connection so that the SUPER user can connect (usually root)

(mysqladmin on the CLI usually just connects as root, and produces the aforementioned sql :)

+75
Nov 05 2018-11-11T00:
source share

Log in to any other EC2 instance, you have access to the corresponding RDS instance and mysqladmin is installed and running

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

you will be asked to enter a password

+26
Mar 12 '13 at 17:24
source share

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

Therefore, you need to issue the "flush hosts" command from another EC2 instance or a remote server that has access to this RDS instance.

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

If this involves starting a new instance or creating / modifying security groups to allow external access, it may be easier to simply log in to the RDS user interface and reload the RDS instance that is locked.

+11
Mar 18 '14 at 13:41
source share

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

[edit: lol downvotes]

+5
Oct 11
source share

Since the hosts are locked. try connecting it from another host and running the mysqladmin flush-hosts command.

 mysqladmin -h <RDS ENDPOINT URL> -P <PORT> -u <USER> -p flush-hosts 
+5
Aug 28 '13 at 1:08 on
source share

On Amazon RDS FLUSH HOSTS; can be executed from the user by default ("Master username" in the RDS information), and this helps.

+3
Jun 11 2018-12-12T00:
source share

You will need to connect RDS through a computer that is installed as mysql on it. I used one of my VPS hosting using SSH

After I was registered in my VPS (I used putty) It was simple, at the prompt I entered the following command:

 mysqladmin -h [YOUR RDS END POINT URL] -P 3306 -u [DB USER] -p flush-hosts 
+1
Oct 9
source share

You can restart the database in RDS Admin.

+1
Jan 15 '14 at 18:19
source share

You can clear the local MySQL host using the following command:

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

or

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

Although the Amazon RDS database server is connected to the network, use the following command, for example, as the MySQL flash network 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 an additional sentence, you can permanently solve the problem of blocking many connection problems by editing the file my.ini [Mysql configuration file]

change variables max_connections = 10000;

or

enter MySQL using the command line -

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

enter the command below into the MySQL window

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

authenticate using command

 show variables like "max_connections"; show variables like "max_connect_errors"; 
0
Jan 18 '16 at 8:55
source share



All Articles