Search Postgresql Archives

Re: Connect to Postgres problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christine Penner wrote:
I'm having trouble getting a connection to Postgres to work from outside of my local network. It was working fine at one point. Then I had to change IP addresses and I can't get it to work. This is what I've done.

On the computer with Postgres installed I have this in the pg_hba.conf file:
host     all     all     207.6.93.152/32         md5

This will only allow the host at 207.6.93.152 to connect. If you're trying to reach the database from any other system, that won't work.

I know the user name and password etc are correct because I can connect locally using the same stuff. The only things that have changed since it was working is IP addresses. I confirmed they are right. Also when trying to get it working I noticed that the port forwarding got disabled somehow so I set that up again but still no luck.

Generally the troubleshooting works like this:

1) Confirm psql connects from the host (with the default, sockets based connection) 2) Confirm psql connects using TCP/IP on that same host. So "psql -h <server ip>" on the server itself. If that doesn't work, probably an issue with listen_addresses or pg_hba.conf 3) Connect to the database from another host on the same local network. If this fails, check pg_hba.conf again, and make sure the server's firewall is configured to allow connections to the port 4) Connect from an outside network. Now any problem you have should be limited to just being related to things like port forwarding.

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@xxxxxxxxxxxxxxx   www.2ndQuadrant.us


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux