Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS RDS: How to Connect to Instance

I just set up an Amazon RDS instance. I have a separate application server and I am trying to figure out how to connect to the RDS instance from my EC2 application server. On the Instance page, I have

enbdpoint: mycompany.czdv3mj7ps25.us-west-2.rds.amazonaws.com:5432

I tried to login into to psql using that address but I got

$ psql -h mycompany.czdv3mj7ps25.us-west-2.rds.amazonaws.com:5432 -U myuser -d mydb
psql: could not translate host name "mycompany.czdv3mj7ps25.us-west-2.rds.amazonaws.com:5432" to address: Name or service not known

How do I connect to the instances database? I don't see any other ip addresses in the RDS console.

like image 504
David Williams Avatar asked Nov 26 '13 01:11

David Williams


1 Answers

You have wrong syntax. The correct syntax is:

$ psql --host mycompany.czdv3mj7ps25.us-west-2.rds.amazonaws.com --port 5432 --username myuser --dbname mydb

You have specified port information wrong in you command. the port has to be specified using --port option and not hostname:port

like image 95
slayedbylucifer Avatar answered Sep 28 '22 08:09

slayedbylucifer