PostgreSQL can't connect from python/psycopg

2

I'm having problem connecting to PostgreSQL through Python/Psycopg2.

The PostgreSQL server is running on 192.168.1.6, CentOS 5.5. I can already connect through LAN workstations using Navicat, I'm pretty sure I had the right post opened in iptables.

But when connecting from Python/psycopg2, I got this error

conn = psycopg2.connect(database='test', user='sql', host='192.198.1.6', password='sql')

Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    conn = psycopg2.connect(database='test', user='sql', host='192.198.1.6', password='sql')
OperationalError: could not connect to server: Connection timed out (0x0000274C/10060)
        Is the server running on host "192.198.1.6" and accepting
        TCP/IP connections on port 5432?

I tried to disable firewall and iptables on both client and server machine, still the same error.

postgresql
asked on Server Fault Nov 15, 2011 by J Penguin • edited Nov 15, 2011 by Bart De Vos

1 Answer

3

LAN? 192.198.1.6? You see the error?
Try:

192.168.1.6

answered on Server Fault Nov 15, 2011 by Erwin Brandstetter • edited Nov 17, 2011 by Erwin Brandstetter

User contributions licensed under CC BY-SA 3.0