Open port 5432 for postgres

I use a database gui for my postgres db. I attempted to setup my connection but am getting a general connection error.
> could not connect to server: Connection refused

Is the server running on host "198.74.xx.xx" and accepting

TCP/IP connections on port 5432?

I've edited both /etc/postgresql/9.5/main/postgresql.conf and /etc/postgresql/9.5/main/pg_hba.conf on the pg end.

What do I need to do in order to open this port up. Or maybe some troubleshooting steps to see if indeed it is getting blocked or if it's a pg problem.

Does this netstat output help?
> tcp 0 0 0.0.0.0:1861 0.0.0.0:* LISTEN -

tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN -

tcp6 0 0 :::1861 :::* LISTEN -

tcp6 0 0 ::1:5432 :::* LISTEN -

thanks

2 Replies

Looks like postgres is only listening on localhost on ipv4/6.

tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN - 
--
tcp6 0 0 ::1:5432 :::* LISTEN 

You'll need to fix this in the postgres conf file.

@derfy:

Looks like postgres is only listening on localhost on ipv4/6.

tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN - 
--
tcp6 0 0 ::1:5432 :::* LISTEN 

You'll need to fix this in the postgres conf file.

duh…that was it…many thanks!!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct