我最近正在使用 VMware Workstation 8 设置并运行 Windows 2008 r2 服务器。
我正在运行带有 Postgresql 9.1 的 Centos 6.2 虚拟 Linux 盒子。本地一切似乎都正常,我可以通过桥接网络连接连接到 CentOS 盒子。
我已关注大卫·盖迪尼 http://www.davidghedini.com/pg/entry/install_postgresql_9_on_centos设置 Postgresql 9.1 的演练。因此,我能够启动 putty 会话窗口,以 root 身份登录并启动 psql shell 并以 postgres 用户身份发出语句。我的问题是我无法从 Windows 7 客户端使用 pgAdmin III 进行连接。我已经更新了/var/lib/pgsql/9.1/data/postgresql.conf
启用listen_addresses'*'等
谁能给我任何关于找出我的错误的提示。确保 Windows 服务器上的 Windows 防火墙也已禁用。
pgAdmin III 客户端报告;
“服务器不听”
服务器不接受连接:连接库报告
无法连接到服务器:连接超时 (0x0000274C/10060) 服务器是否在主机“192.168.1.26”上运行并接受端口 5432 上的 TCP/IP 连接?
这是pg_hba.conf
添加的文件条目:
#TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.1.0/24 trust
并添加 iptables 文件条目:
-A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 192.168.1.26 --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -s 192.168.1.26 --sport 5432 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
你需要调整pg_hba.conf
:
http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
添加自己的主机和相应的用户后,重新启动 postgresql 服务器,希望可以连接。
此外,您可能需要在网络上启用它的端口:http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)