AWS MySQL connection frequently times out

Viewed 19179

I have a MySQL database in AWS (RDS), and I connect to it from command line via this command:

mysql -u _usernme_ -p_mypassword_ -h  _aws_mysql_host_ _dbname_

It connects fine, problem is, if it remains idle for 1-2 minutes, the connection dies, subsequent commands just hang. I have to kill the process and start a new one.

What configuration changes do I need to do, and where, so that it stays alive forever, just like localhost, until I expressly terminate the connection?

4 Answers

Let check the below screenshot for details how it's fixed. enter image description here

While Connecting MAKE SURE that both Inbound and Outbound rules for your database has MYSQL/AURORA to Anywhere and Custom TCP too

Related