user3230380
user3230380

Reputation: 31

AWS EC2 cannot connect to RDS

Guys I had troubles with my EC2, I connected the EC2 through SSH successfully and used command line like “mysql -h **..rds.amazonaws.com (myRDS Endpoint) -p 3306 -u ** -p**” to connect to the RDS, unfortunately, I got this error after a while: "ERROR 2003 (HY000): Can't connect to MySql server on '**..rds.amazonaws.com' (110)'', there were several comments:

  1. This EC2 and RDS are in same region and same available zone (Tokyo).
  2. This EC2 is an classic one not VPC.
  3. I can connect to to this Tokyo RDS through an EC2 located in other region (Singapore).
  4. I get the same ERROR Info when using this Tokyo EC2 to connect to a RDS in Singapore and I'm sure Singapore RDS is available.
  5. I tried "nc -zv 3306" using Tokyo EC2, but got a "time out" error while it succeed when using Signore EC2 to do this.
  6. I checked the iptables of the Tokyo EC2, but there was no iptables there.
  7. So, I doubt the problem is the EC2 not the RDS.
  8. I google this and found the most similar questions are caused by SG, reason of this problem,

Very appreciated if any help, thanks in advance.

Best Regards

Beyond Wang

Upvotes: 0

Views: 532

Answers (2)

Greg Fennell
Greg Fennell

Reputation: 176

You need to make sure that the security group your EC2 instances are in is added to the security group for the RDS instance.

Upvotes: 1

Richard Irwan Shah
Richard Irwan Shah

Reputation: 21

You need to add your server IP to the RDS whitelist.

Upvotes: 0

Related Questions