【发布时间】:2014-04-17 08:58:12
【问题描述】:
我正在尝试从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。
【问题讨论】:
标签: postgresql