postgresql – pgAdmin III:拒绝访问数据库

前端之家收集整理的这篇文章主要介绍了postgresql – pgAdmin III:拒绝访问数据库前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试从 pgAdmin III连接到远程数据库.我创建了一个“新服务器注册”.当我连接到数据库时,我得到“访问数据库被拒绝”.

我设置正确.这些是我的Postgresql设置:

> pg_hba.conf>

Postgresql客户端身份验证配置文件

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             postgres                                trust
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost,by a user with the
# replication privilege.
host    all             all             192.168.0.0/16          md5

> postgresql.conf>我允许所有输入连接listen_addresses =’*’

使用SSH我可以连接到数据库

[fuiba@test]$psql -h localhost -p 26888 -d postgres
psql (9.1.11)
Type "help" for help.

postgres=# \l
                             List of databases
     Name     |  Owner  | Encoding | Collate | Ctype |  Access privileges  
--------------+---------+----------+---------+-------+---------------------
 postgres     |  fuiba  | UTF8     | C       | C     | 
 template0    |  fuiba  | UTF8     | C       | C     | =c/fuiba         +
              |         |          |         |       | fuiba=CTc/fuiba
 template1    |  fuiba  | UTF8     | C       | C     | =c/fuiba         +
              |         |          |         |       | fuiba=CTc/fuiba
(3 rows)

我究竟做错了什么?任何帮助将受到高度赞赏.谢谢!

ps:我在Windows 7上运行pgAdmin III,在Linux CentOS上运行Postgresql.

解决方法

与通过SSH登录数据库服务器时相比,pgAdmin从其他主机连接到Postgresql.您的pg_hba.conf中未提及错误消息(以93.39开头)中提到的IP地址.

将运行pgAdmin的主机的公共IP地址(以93.39开头的地址)添加到pg_hba.conf或通过SSH隧道连接.注意在修改pg_hba.conf后重新加载Postgresql的配置或重启Postgresql.

@H_403_44@

猜你在找的Postgre SQL相关文章