Reputation: 21
I have an AWS RDS database I can't connect, I get the following error:
mysql -h rds.eu-west-1.rds.amazonaws.com -P 3306 -u admin
ERROR 2003 (HY000): Can't connect to MySQL server on 'rds.cfckm0d26fsq.eu-west-1.rds.amazonaws.com:3306' (60)
The RDS security group allows all traffic for my IP as well explicit opens 3306 Also I have my RDS as Publicly accessible (which I don't like)
To travelshoot, I also open my security group to the world: 0.0.0.0/0, but the error remains
Upvotes: 2
Views: 3831
Reputation: 31
You needn't keep the security permissions Public
.
You can just add the public IP of the inbound traffic to the Security Group for the RDS DB you are using. When you open the RDS DB instance, open the VPC Security Group
--> Security Group ID
--> Edit Inbound Rules
--> Add your IP
.
This solved my issue.
Upvotes: 1
Reputation: 21
As I was on a private subnet, t didn't matter if I opened ports to the world. To trouble shoot I telnet the RDS
telnet rds.eu-west-1.rds.amazonaws.com 3306
And I saw there was no connectivity. So I created an EC2 within the same subnet and from it connected to the RDS.
NOTE: no need to have all traffic open (as I saw on my posts and youtube), just 3306 to private or requesting ip and for port 3306. Also no need to make the RDS public
Upvotes: 0