sumanth shetty
sumanth shetty

Reputation: 2181

EC2 ubuntu machine not able to connect to PostgreSQL RDS

I have an EC2 Ubuntu machine that is trying to establish a connection to Postgress RDS Machine. I have allowed all outbound traffic for my ec2 machine. for inbound for RDS, I have allowed all UDP, all TCP, and all ICMP Ipv4 traffic with source as a security group of EC2 machine.

I feel my EC2 is not able to connect to the RDS instance. Both are in the same default VPC.

I tried :

ping hostname 

from my EC2, which doesn't connect and also tried

 psql yellow-pages -U yp_develop -h hostname Password

I get

psql: FATAL:  database "yellow-pages" does not exist

anything that I am missing or I understood the concept wrongly that I am not able to solve this issue.

Please if anyone cloud solve this problem.

Upvotes: 2

Views: 188

Answers (1)

Chris Williams
Chris Williams

Reputation: 35146

The database is connectable by attempting to use telnet to connect to it.

The issue appeared to be that either the user does not have permission to the database yellow-pages or the database yellow-pages does not exist.

To validate this the telnet $HOSTNAME 5432 command was run and it was able to connect.

After this the psql -U yp_develop -h $HOSTNAME -l command was carried out validating that there was no yellow-pages database setup on this RDS instance.

Upvotes: 1

Related Questions