Can’t authorize a server for Amazon RDS

amazon-rdsamazon-web-servicescidrip

We are attempting to slowly migrate a website over to AWS among other things. We decided the first thing to move was the database. We have some dedicated server with a different hosting provider. We only have one IP. I am having trouble authorizing the ip so that the old server can connect to RDS. It simply hangs for a while while using the mysql cli, then responds:

ERROR 2003 (HY000): Can't connect to
MySQL server on
'db.address.us-east-1.rds.amazonaws.com'
(110)

It did work on my laptop though. I am not quite sure what is wrong. I have a feeling I don't quite understand CIDR/IP. I simply took the ip address and tacked on /32 at the end. Then I gleaned some information that it also has to do with subnet mask? ifconfig reports: 255.255.255.0

I found a calculator and the IP changed a bit and had /24 at the end. That still didn't work.

One other note… perhaps i dont know enough about the differences between OS. The hosting provider is using centOS, while our development machines are all ubuntu.

Any insight would be extremely helpful! THANKS 🙂

Best Answer

If it works from your laptop, apparently you have authorized the IP at which your laptop appears on the Internet to connect to RDS. Browse whatismyip.com to see that public IP. If you browse to whatismyip from your dedicated server, you can verify that server's public IP, and make sure it is authorized in AWS. If it's just one IP, enter it as x.x.x.x/32.

If you use tcp port 3306 for MySQL, from a shell/cmd prompt on the dedicated server, enter

telnet db.address.us-east-1.rds.amazonaws.com 3306

If the connection times out instead of opening a new window, and you confirm that your dedicated server's public IP is authorized, then something in your server or hosting provider's network is probably blocking your connection. Support should be able to help find and fix it.