- Mais recentes
- Mais votos
- Mais comentários
Hello.
If you encounter an error when connecting, could you please share the error message?
Also, could you please share your EC2 security group settings and RDS security group settings?
If you get a timeout error, you may need to check the settings of your security group, subnet network ACL, Windows firewall, etc.
https://repost.aws/knowledge-center/rds-cannot-connect
You also need to make sure that "enableDnsHostnames" and "enableDnsSupport" are enabled in your VPC.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html
If you want your DB instance in the VPC to be publicly accessible, make sure to turn on the VPC attributes DNS hostnames and DNS resolution.
Ec2 instance(windows) and RDS MySQL both are in same vpc same region and on private subnet
Can you confirm that the EC2 instance and RDS instance are in the same subnet?
Tried by adding security group but it doesnt help.
Which security group settings did you try? Assuming that MySQL is running on its default port 3306, your EC2 instance will need a security group with an outbound rule allowing TCP port 3306 to the RDS instance's private IP address (or subnet, or just make it 0.0.0.0/0 for troubelshooting, you can tighten it later). On the RDS instance, it will need a security group associated with it which has an inbound rule allowing TCP port 3306 from the EC2 instance's private IP address (or subnet, or again just make it 0.0.0.0/0 to get it working).
Hi Steve, Thanks for your update. Ec2 instance and RDS are in subnet. As like your assumption only i have configured security groups of RDS and EC2. My application which is hosted on IIS in windows server Ec2 instance is not connecting with Mysql RDS database.
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há um ano
Hi Riku, Didier, Thanks for your suggestion. As like steve said assumption only had my security groups. And also, "enableDnsHostnames" and "enableDnsSupport" enabled in my VPC.