解决PostgreSQL连接失败
发布时间:2020-12-13 17:05:34 所属栏目:百科 来源:网络整理
导读:? 问题 在pgAdmin中,将本地数据库连接的host由 localhost 或 127.0.0.1 改为自己的真实ip– 10.xxx.xxx.xxx 后,连接失败,报错如下: psql: could not connect to server: Connection refused Is the server running on host "my host name" (IP) and acce
?问题在pgAdmin中,将本地数据库连接的host由 psql: could not connect to server: Connection refused
Is the server running on host "my host name" (IP) and accepting
TCP/IP connections on port 5432?
解决出现上述问题时,需修改postgresql.conf和pg_hba.conf文件。 此文件位于postgresql数据文件目录中,默认为 pg_hba.conf中增加需要连接该数据库主机的ip地址。如下所示,增加对主机 host all all 10.xxx.xxx.xxx/32 trust
如上设置后,使用 解释原来,在客户端访问PostgreSQL数据库时,PostgreSQL会读取文件 参考
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |