Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, I just created the Amazon RDS account. And I started an instance of database.

The "endpoint" is:

Great! Now I try to connect to it from one of my other EC2 instances.

mysql -uUSER -pPASS

But nothing works and it just hangs.

I tried to ping it, and nothing works either. Nothing happens.

Do I need to change some settings?

share|improve this question
up vote 28 down vote accepted

By default RDS does not allow any connection that is not specified within the Security Group (SG). You can allow based on CIDR addressing or by Amazon account number which would allow any EC2 under that account to access it.

share|improve this answer

It is "just hanging" as you have not configured the firewall to accept mySQL connections from your other instance, as such the packet is being dropped at the firewall level, to resolve this you need to:

  1. head into your AWS console
  2. EC2 tab
  3. Note down the security group of your mySQL server (well call this SG-MYSQL for now)
  4. click security groups on the left of the console
  5. click your group in the center menu SG-MYSQL
  6. click inbound tab
  7. select mySQL from the list, add the details of your client server and save the rule

NOTE the source IP for the server will not be your elastic IP (in most cases anyway) you will have an internal ip on the device (ifconfig on linux will show you this).

share|improve this answer
I've done that on my EC2 server. I've opened all the standard ports. – Alex Apr 25 '11 at 20:20
My EC2 server can connect to every other MySQL database just fine (the databases on other servers.) Just not my new RDS database. How can I check if I created the RDS database correctly? – Alex Apr 25 '11 at 20:22
I have no EC2 instance and my RDS couldn't connect to outside world until I did this. – Neutralizer Nov 22 '14 at 14:02
excellent point to use elastic IP! – user1641443 Mar 23 '15 at 9:42
Thanks for this. The walkthrough has made all the difference! – Mr T Feb 22 at 22:18


Had to grant access to it in the security groups under the DB...

share|improve this answer
Can you elaborate on what you did to grant access? – David Csonka Jun 22 '12 at 5:15
My database has a security group with one rule. Allow access from ANYWHERE to port 1433. I can't connect -_- – The Muffin Man May 29 '14 at 16:44

A lot of talk here about security groups, but also check:

  • Do the associated Subnets seem properly configured?
  • Are the Subnets part of a Routing Group that seems properly configured (Internet Gateway specified, etc?)
  • Does the RDS say it's Publicly Accessible?
  • And of course check the RDS Security Group and EC2 Security Group
    • Don't forget your actual source IP may be an internal IP (if accessing internally via a VPC) or an external IP (which may be a router's IP, or an EC2 instance's Instance IP which is distinct from its Load Balancer / Elastic IP) -- to troubleshoot, you may try to allow access to all IPs and ports.

(The routing group was my problem; in creating a new subnet, I neglected to add it to a routing group with a gateway.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.