0

The mysql instance is a third party Heroku addon: JawsDB.

Host:

s554ongw9quh1xjs.cbetxkdyhwsb.us-east-1.rds.amazonaws.com

Command:

mysqladmin -h s554ongw9quh1xjs.cbetxkdyhwsb.us-east-1.rds.amazonaws.com -P 3306 -u username -p flush-hosts

Mysql Server Error:

Host '65.130.48.40' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'.

Source

https://chartio.com/resources/tutorials/how-to-run-mysqladmin-flush-hosts-on-amazon-rds/

What is a straight forward approach to flush the remote cache in this kind of a setup?

iamtoc
  • 103
  • 4

1 Answers1

1

You have to run the command from a machine that is not already blocked. It doesn't need to be the local machine (which is impossible from RDS, anyway). The mysqladmin utility is nothing more than a simple utility that connects to the server using an ordinary client connection and issues commands, usually as queries but sometimes as low level protocol op codes -- but in every case, it uses a normal connection, so it's not immune to being blocked.

Rebooting the server instance is a solution that can be used in an emergency situation, though this would normally be reserved as a last-ditch effort.

The blocking is triggered by a client crossing the max_connect_errors threshold. You may consider increasing this threshold in the RDS parameter group, but that is rarely necessary, since crossing the threshold usually signifies that something has gone fairly seriously wrong and needs to be investigated. This is a protective control, to allow the server to quickly dismiss a client machine that seems either broken or malicious, allowing the server to expend minimal resources dealing with the misbehaving client. Health-checking a MySQL server using a simple/naïve TCP connection attempt that does not actually try to authenticate can also trigger this condition, since the client doesn't actually go through the expected handshake sequence after the connection is established.

The counter for a given host should set itself back to 0 for each successful connection, so under normal circumstances, crossing the threshold should be rare.

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81
  • 1
    "You have to run the command from a machine that is not already blocked". This is what i did not understand. Thanks Michael - sqlbot – iamtoc May 06 '18 at 18:08