I’ve set up a basic AWS RDS in the free tier. No public access but created a security group with my IP address added as an inbound rule.
For authentication I have RDS password plus AWS IAM.
I try to connect to the db via my computer (Ubuntu) with the following command:
mysql -h <db-conn>.amazonaws.com -P 3306 -u admin -p
I’ve already looked at this answer – Cant connect to mysql server on AWS RDS My port isn’t blocked and I’ve checked the security group. I am able to successfully run AWS CLI commands like this:
aws rds describe-db-instances --filters "Name=engine,Values=mysql" --query "*.[DBInstanceIdentifier,Endpoint.Address,Endpoint.Port,MasterUsername]"
But every time I run the
mysql command, I get the following error:
ERROR 2002 (HY000): Can't connect to MySQL server on '<db-conn>.amazonaws.com' (115)
Would love some assistance with this. Thanks!
RDS has a security group – in the AWS console, RDS, there’s an entry for security groups.
If you didn’t explicitly create a security group, you are probably using “default”. You should probably have one group per RDS instance.
You will need to make sure that port 3306 is open to your local network, as well as whatever application you will be using to connect to it. You can allow access by IP or by security group.