Alex Rivera | Logout

Unable to connect to PostgreSQL server: could not connect to server: Permission denied

Asked 2011-11-15T17:56:57.273
10

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Permission denied Is the server running on host "10.0.1.201" and accepting TCP/IP connections on port 5432?

This is the error i am getting when trying to connect to remote database from linux based server

Though i am able to connect to it from localhost

Can anyone help me in this

Edit
Report

2 Answers

2

Check the listen_addresses setting in postgresql.conf. If it is set to localhost, then only loopback connections will be accepted, and remote connections will get a "connection refused" error. Set listen_addresses to "*" to enable listening on all interfaces.

answered 2011-11-15T20:05:06.210
1

In PostgreSQL you have to configure client authentication in pg_hba.conf on the remote server.

Read more about pg_hba.conf @ http://developer.postgresql.org/pgdocs/postgres/auth-pg-hba-conf.html , otherwise you'll never connect to that server :).

Hope it will help, Stefan

answered 2011-11-15T18:22:34.837

Your Answer