How to access an AWS RDS host in a VPC

amazon-rdsamazon-web-services

I have setup my first AWS VPC. It has a public subnet, and two private subnets. One of the privates has an RDS instance, and the other is vacant (in a different AZ). I followed the tutorials on AWS to set up the routing and VPC Security Groups. I don't have NAT server for the private subnets.

My question is, how do I go about accessing the RDS instance in the private subnet using the MySql client? I set up rules in the Web Server Security Group that allows outbound access on 3306, and the Database Security Group allows inbound access on the same port.

When I SSH into the server on the public subnet and run mysql -h hostname -p I get an error message about an unknown host name. I tried the full RDS endpoint name as the host name. I also tried just the host-name portion of the name. Am I going about this the right way? Does the MySql client use the 3306 port? Or do I have to open another port?

Best Answer

Found the answer. I need to specify the port number when making the connection, per this article: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html