PostgreSQL pg_hba.conf 问题
在 pg_hba.conf 中,我
host all all 127.0.0.1/32 md5
host all all samenet md5
也添加了
host all all samehost md5
两者。
我正在使用 pgAdminIII,尝试创建“新服务器注册”。当我连接到(本地主机)时,它工作正常。但是,当我将主机更改为实际工作站名称时,它会显示:
FATAL: no pg_hba.conf entry for host "fe80::c81c:9e9c:6570:d0bf%20", user "postgres", database "postgres", SSL off
附加信息
- 操作系统:Windows 7 Ultimate 32 位
- PostgreSQL Server 9.0.2
对此的任何帮助将不胜感激。
In pg_hba.conf, I have
host all all 127.0.0.1/32 md5
host all all samenet md5
I also added
host all all samehost md5
on both.
I am using pgAdminIII, trying create a "New Server Registration". When I connect to (localhost), it works fine. But when I change the host to the actual workstation name it says:
FATAL: no pg_hba.conf entry for host "fe80::c81c:9e9c:6570:d0bf%20", user "postgres", database "postgres", SSL off
Additional Information
- Operating system: Windows 7 Ultimate 32 bit
- PostgreSQL Server 9.0.2
Any help on this would be highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是在启用 IPv6 的 Windows 计算机上安装 PostgreSQL 时出现的问题。临时解决方法是传递参数“-h 127.0.01”,如本文所述。
http://postgresql.1045698.n5.nabble.com/FATAL-no-pg-hba-conf-entry-for-host-1-td1873063.html
This is the issue of PostgreSQL installations on Windows computers having IPv6 enabled. Temporary workaround would be passing paramter "-h 127.0.01" as described in this article.
http://postgresql.1045698.n5.nabble.com/FATAL-no-pg-hba-conf-entry-for-host-1-td1873063.html
其他用户已经在这里回答了这个问题,但我想在这里显示答案,以便其他人更清楚:
在 pg_hba.conf 中,添加您的 ipv6 地址,如下所示:
fe80::c81c:9e9c:6570:d0bf 是您的 ipv6 地址。
This has been answered by other user here, but I want to show the answer here to make more clear for others:
In pg_hba.conf, add your ipv6 address like this:
fe80::c81c:9e9c:6570:d0bf is your ipv6 address.
请注意,
samehost
和samenet
依赖的接口枚举代码非常依赖于平台。 (目前有 5 种针对不同平台的单独实现。)因此,对一种设置有效的方法可能在其他地方无效。也就是说,类似的设置在 Linux 上适用于我,也就是说,
在适当设置
listening_addresses
和samenet
后,我可以使用它连接到本地主机上的数据库服务器。因此可以想象,Windows 中的接口枚举代码不知何故未能包含链接本地地址。
如果您已经充分隔离了这个问题,我会向 PostgreSQL 发送错误报告以进一步分析该问题。
Note that the interface enumeration code that
samehost
andsamenet
rely on is very platform-dependent. (There are currently 5 separate implementations for different platforms.) So what works for one setup might not work somewhere else.That said, the analogous setup works for me on Linux, that is, I can connect to the database server on the local host using
after setting
listening_addresses
andsamenet
appropriately.So it's conceivable that the interface enumeration code in Windows somehow fails to include the link-local addresses.
If you have isolated this problem enough, I would send a bug report to PostgreSQL to analyze the issue further.
我遇到了同样的问题,并通过关闭两台机器上的 ipv6 支持来解决它。不确定这是否适合您。
I had the same problem and solved it by turning off ipv6 support on both machines. Not sure if this is an option for you.
您也可以
用于本地主机。
You can also use
for the localhost.
尽可能关闭适配器上的 IPV6。
之后,执行
此操作将禁用您无法从 GUI 中看到的虚拟网络接口。
Turn off IPV6 on adapters that you can.
After that, do
This will disable virtual network interfaces that you can't see from GUI.