Saurabh Bhatia
Saurabh Bhatia

Reputation: 789

Amazon RDS PostgreSQL not accepting TCP connections on port 5432

I have created a PostgreSQL Amazon RDS databaes but I cannot connect to it from my local machine.

I am connecting like this:

psql -h <db endpoint> -p 5432 -U <username> <db name>

Response is:

Is the server running on host and accepting TCP/IP connections on port 5432?

Here are the database settings:

RDS settings

Here are my security group settings:

Security group inbound rules

Upvotes: 6

Views: 21267

Answers (2)

Trang Pham
Trang Pham

Reputation: 181

If you don't want to have Publicly Accessible = Yes then you should ensure that you've set a Security Group which has an Inbound rule. You'd have to then ensure that the security group is set up correctly.

Upvotes: 11

John Rotenstein
John Rotenstein

Reputation: 269410

Your configuration picture is showing a setting of Publicly Accessible = No.

You will need to modify your database to set this to Yes.

From Modifying a DB Instance Running the PostgreSQL Database Engine:

Publicly Accessible

Choose Yes to give the DB instance a public IP address, meaning that it will be accessible outside the VPC (the DB instance also needs to be in a public subnet in the VPC); otherwise, choose No, so the DB instance will only be accessible from inside the VPC.

Upvotes: 15

Related Questions