pgAdmin3 连接问题 [英] pgAdmin3 connection problems

查看:26
本文介绍了pgAdmin3 连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近正在使用 VMware Workstation 8 设置和运行 Windows 2008 r2 服务器.

I'm recently setting up and running a Windows 2008 r2 server with VMware Workstation 8.

我正在使用 Postgresql 9.1 运行 Centos 6.2 虚拟 Linux 机器.本地似乎一切正常,我可以通过桥接网络连接到 CentOS 机器.

I'm running a Centos 6.2 virtual linux box with Postgresql 9.1. Everything seems ok locally and I can connect to the CentOS box via a bridged network connection.

我已按照 David Ghedini 的演练设置 Postgresql 9.1.所以我能够启动一个腻子会话窗口,以 root 身份登录并启动 psql shell 并以 postgres 用户身份发出语句.我的问题是我无法从我的 Windows 7 客户端使用 pgAdmin III 进行连接.我已更新 /var/lib/pgsql/9.1/data/postgresql.conf 以启用 listen_addresses '*' 等.

I have followed David Ghedini's walkthrough for setting up Postgresql 9.1. So I am able to start a putty session window, log in as root and start psql shell and issue statements as postgres user. My problem is that I cannot connect using pgAdmin III from my Windows 7 client. I have updated the /var/lib/pgsql/9.1/data/postgresql.conf to enable listen_addresses '*', etc.

谁能给我一些关于找出我的错的提示.确保在 Windows 服务器上也禁用了 Windows 防火墙.

Could anyone give me any tips on finding my fault. Have ensured Windows Firewall is disabled on the Windows server, too.

pgAdmin III 客户端报告;

The pgAdmin III client reports;

'服务器不听'

服务器不接受连接:连接库报告

The server doesn't accept connections: the connection library reports

无法连接到服务器:连接超时 (0x0000274C/10060) 服务器是否在主机192.168.1.26"上运行并接受端口 5432 上的 TCP/IP 连接?

could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "192.168.1.26" and accepting TCP/IP connections on port 5432?

这是添加的 pg_hba.conf 文件条目:

This is the pg_hba.conf file entry added:

#TYPE DATABASE   USER   ADDRESS          METHOD
host  all        all    192.168.1.0/24   trust

并添加了 iptables 文件条目:

And the iptables file entries added:

-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

添加自己的主机和相应用户后,重新启动 postgresql 服务器,希望您可以连接.

Once you add your own host and corresponding user, restart postgresql server so hopefully you can connect.

您可能还需要在网络上启用它的端口:http://www.cyberciti.biz/tips/postgres-allow-remote-访问-tcp-connection.html

Also you might need to enable it's port on the network: http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html

这篇关于pgAdmin3 连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆