【发布时间】:2018-09-05 00:24:29
【问题描述】:
我有一台安装了 Postgres 的服务器,我想允许来自外部 IP 的连接。 Postgres 非常适合本地连接,然后在文件末尾/var/lib/pgsql/data/postgressql.conf 我添加了:
listen_addresses = '*'
在/var/pgsql/data/pg_hba.conf的末尾我补充说:
host all all 0.0.0.0/0 md5
host all all ::/0 md5
然后我重新启动了 postgres:sudo systemctl restart postgresql
并尝试联系:psql -h my.db.server.ip -U postgres
我得到:
psql: could not connect to server: No existe ninguna ruta hasta el «host»
Is the server running on host "my.db.server.ip and accepting
TCP/IP connections on port 5432?
我正在使用 Centos 7 和 PostgreSQL 9.2.23 我还应该做什么?
【问题讨论】:
标签: postgresql centos centos7