0

I have imported a CentOS VM to EC2, it is running correctly. I created a MySQL RDS. They are both apparently in the same VPC.

From the shell in my VM I tried this command:

mysql -u root -h mydatabase-db2.cxyzzz85zzzz.eu-west-1.rds.amazonaws.com -p

When I enter the password I get this error:

ERROR 2005 (HY000): Unknown MySQL server host 
'mydatabase-db2.cxyzzz85zzzz.eu-west-1.rds.amazonaws.com' (1)

DNS seems to work ok on my EC2 VM. Both EC2 and RDS are in the same VPC. I configured the RDS to be 'Publicly Available' when I created it. What else could I have missed?

1
  • Need more details. Specifically: What does the security group your RDS instance is using look like? Is this security group allowing inbound MySQL (3306) traffic from your EC2 instance? Is your RDS in a public subnet? Nov 3, 2015 at 22:43

2 Answers 2

1

Even if the EC2 instance and RDS instance share the same security group, you will need to make sure that port 3306 (or whatever port you've configured MySQL to use) is allowed inbound from itself (literally put the same SG id into the source/CIDR field).

0

Hi Think this can be resolved by changing the DHCP options set to Amazon provided DHCP options. Since the issue can be, your host is not able to resolve that RDS endpoint

1
  • 1
    Thanks, 3 years too late though :)
    – blarg
    Sep 25, 2018 at 13:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .