- Newest
- Most votes
- Most comments
hi,
It looks like that you need to make sure mysql 3306 port is opened.
I hope the below knowledge will help you.
How can I connect to a private Amazon RDS DB instance from a local machine using an Amazon EC2 instance as a bastion host? https://repost.aws/knowledge-center/rds-connect-ec2-bastion-host
Also please refer the AWS document.
Can't connect to Amazon RDS DB instance https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Troubleshooting.html#CHAP_Troubleshooting.Connecting
Hi Subha,
your connection error likely stems from security group or NAT Gateway configuration. Here I will provide
Check Security Groups:
- Ensure the RDS security group allows inbound traffic on port 3306 from your VM's security group ID.
- Verify your VM's security group allows outbound traffic on port 3306 to the RDS endpoint (not the public DNS).
Verify NAT Gateway:
- Confirm the private subnet's route table is associated with the NAT Gateway.
- Make sure the NAT Gateway is launched in a public subnet with internet access.
Test Connectivity:
From your VM, try pinging the NAT Gateway's public IP to ensure network reachability.
refferal link: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html
Thanks for your update. I have tried the shared update but for me, while testing ping command in vm using nat gateway public ip address, it doesnt work, shows request timed out error. My natgateway has public subnet with internet gateway connected to that subnet.
Relevant content
- asked 15 days ago
- asked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Thanks for your update. My rds security group rule added, that is, it should allow port 3306 and also allow all traffic from anywhere 0.0.0.0/0. Eventhough had rule facing problem on connecting..