Error 2003 (HY000) when i try to connect amazon rds server from ec2 server

amazon-web-services

I know I need to configure the RDS security group to allow connection from EC2 security group.

I have an EC2 instance running in the default security group. so i added the EC2 Security Group to the RDS DB security group. When I try to connect using the mysql client from my EC2 instance it gives me the following error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'xxxx.xxxx.us-east-1.rds.amazonaws.com' (110)

the command i used is:

mysql -udbuser -p -hxxxx.xxxx.us-east-1.rds.amazonaws.com

I found this post with the exactly same issue I have, but no one answers

https://forums.aws.amazon.com/message.jspa?messageID=328603

I am able to add CIDR/IP rules and works just fine from my laptop. However, I really need my ec2 instance hook up with my rds. Thanks in advance for any help.

Best Answer

I have fixed this issue by adding the public ip address of my EC2 server to the DB security group default policy.