0
votes

I'm trying to connect to my new AWS RDS I just made. I followed the "Setting up for RDS" (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SettingUp.html), then the "Tutorial: Create an Amazon VPC for Use with a DB Instance" (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateVPC.html), then the "Creating a MySQL DB Instance and Connecting to a Database on a MySQL DB Instance" (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.MySQL.html) but I'm not able to connect to my DB from my computer or my dedicated server on the web.

Following the previous docs, I have this config :

My DB instance DB

The VPC VPC

The subnetworks Subnets

Example of subnetwork's details : SubnetExample

The first security group : Security

The second security group, calling the first one : Security2

For the first security group, I put both my private IP and the IP of my dedicated server, and their ports. I even tried to put 0.0.0.0/0 for SSH and TCP, it didn't work either.

For the DB instance, I tried to add the two security group instead of only the db-securitygroup, it didn't work. I tried to use a different Port for the DB instance, it didn't work.

With MySQL Workbench or with PDO on my dedicated server, I'm unable to connect to the DB : "SQLSTATE[HY000] [2003] Can't connect to MySQL server on [...]"

2

2 Answers

1
votes

I think your security groups are incorrect. If the RDS instance is the only thing you currently have running in the VPC, then you should only have one security group, which is assigned to the RDS server, and that security group should have a rule for port 3306 that allows ingress from your personal IP address, and your dedicated server's IP address.

0
votes

Take a look to this instruction, pay attention to step 3, 4 and 5. It is for ElasticSearch but I think in your case steps are similar