我有问题通过Python / Psycopg2连接到PostgreSQL。
PostgreSQL服务器运行在CentOS 5.5的192.168.1.6上。 我已经可以通过局域网工作站使用Navicat进行连接了,我很确定我在iptables中打开了正确的文章。
但是从Python / psycopg2连接时,我得到了这个错误
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?
我试图禁用客户端和服务器上的防火墙和iptables,仍然是相同的错误。
LAN? 192.198.1.6 ? 你看到错误?
尝试:
192.168.1.6