使用pgAdmin访问远程Postgres服务器 [英] Access remote Postgres server with pgAdmin

查看:195
本文介绍了使用pgAdmin访问远程Postgres服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的XP机器上正在运行pgAdmin.网络上有一台Centos机器运行一个Postgres服务器. Postgres服务器pg_hba.conf文件包含以下几行

I've got pgAdmin running on my XP machine. There's a Centos machine running a Postgres server on the network. The Postgres server pg_hba.conf file has the following lines

TYPE      DATABASE    USER      CIDR-ADDRESS       METHOD
host      all         all       10.0.0.68/32       trust
local     mydb        myuser                       password
local     all         postgres                     ident
host      mydb        myuser    10.0.0.68/32       password
host      all         postgres  10.0.0.68/32       trust

我的postgresql.conf文件具有以下行:

listen_address = 'localhost, 10.0.20.10'

nmap -sS 10.0.20.10显示:

PORT      STATE     SERVICE
5432/tcp  open      postgresql

我可以使用ssh进入服务器上的bash shell,但无法与pgAdmin连接.我得到以下信息:

I can ssh into a bash shell on the server, but I can't connect with pgAdmin. I get the following:

无法连接到服务器:没有到主机的路由(0x00002751/10065)是 服务器在主机"10.0.20.10"上运行并接受TCP/IP连接 在端口5432上?

could not connect to server: No route to host(0x00002751/10065) Is the server running on host "10.0.20.10" and accepting TCP/IP connections on port 5432?

我不知道问题出在哪里.

I've no idea what the problem is.

推荐答案

@Aidan自己找到了解决方案:

@Aidan found the solution himself:

这是防火墙问题.

service iptables stop

启用了连接.我只写一条规则以允许连接.

enabled the connection. I'll just write a rule to allow the connection.

这篇关于使用pgAdmin访问远程Postgres服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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