gpt4 book ai didi

postgresql - Postgres : missing or erroneous pg_hba. 配置文件

转载 作者:行者123 更新时间:2023-11-29 11:20:53 25 4
gpt4 key购买 nike

我的办公 table 上有 2 台机器连接到同一个 IP 网络。我正在尝试将应用程序从一台机器连接到另一台机器上的 postgres 数据库。起初,带有应用程序的主机给我 PSQLException:

FATAL: no pg_hba.conf entry for host "192.168.1.18", user "user1", database "test", SSL off

所以我编辑了我的 pg_hba.conf 文件以接受 IP 地址:192.168.1.18,在文件末尾添加以下行:

host    pnp         all         192.168.1.18      trust

然后我得到另一种类型的错误信息:

FATAL: missing or erroneous pg_hba.conf file

这里有什么我遗漏的吗?

谢谢,兰斯洛特

最佳答案

您还必须指定主机的网络掩码。所以用“192.168.1.18/32”或“192.168.1.18 255.255.255.255”代替裸 IP 地址。

参见 the pg_hba.conf file有关详细信息,请参阅在线手册中的章节。

关于postgresql - Postgres : missing or erroneous pg_hba. 配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/745019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com