我试图在
Windows上使用pgAdmin连接到localhost的Ubuntu 12.04 VM上运行的postgresql 9.1.8.主机的端口5432转发到VM的端口5432.
pgAdmin错误:
连接到服务器时出错:无法从服务器接收数据:软件导致连接中止(0x00002745 / 10053)
postgresql.conf中
#------------------------------------------------------------------------------ # CONNECTIONS AND AUTHENTICATION #------------------------------------------------------------------------------ # - Connection Settings - listen_addresses = '*' port = 5432
的pg_hba.conf
local all postgres peer # TYPE DATABASE USER ADDRESS METHOD host all all 0.0.0.0/0 md5 host all all 127.0.0.1/32 md5 host all all ::1/128 md5
netstat -nlp | 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 29035/postgres unix 2 [ ACC ] STREAM LISTENING 50823 29035/postgres /var/run/postgresql/.s.PGsql.5432
iptables规则
iptables -I INPUT -p tcp --dport 5432 -j ACCEPT