PostgreSQL pg_hba.conf 问题

发布于 2024-11-19 05:53:02 字数 639 浏览 2 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

提笔书几行 2024-11-26 05:53:02

这是在启用 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

清醇 2024-11-26 05:53:02

其他用户已经在这里回答了这个问题,但我想在这里显示答案,以便其他人更清楚:

在 pg_hba.conf 中,添加您的 ipv6 地址,如下所示:

host      all        all       fe80::c81c:9e9c:6570:d0bf/128       md5

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:

host      all        all       fe80::c81c:9e9c:6570:d0bf/128       md5

fe80::c81c:9e9c:6570:d0bf is your ipv6 address.

时光瘦了 2024-11-26 05:53:02

请注意,samehostsamenet 依赖的接口枚举代码非常依赖于平台。 (目前有 5 种针对不同平台的单独实现。)因此,对一种设置有效的方法可能在其他地方无效。

也就是说,类似的设置在 Linux 上适用于我,也就是说,

psql -d postgres -h 'fe80::xxxx:xxxx:xxxx:xxxx%eth0'

在适当设置 listening_addressessamenet 后,我可以使用它连接到本地主机上的数据库服务器。

因此可以想象,Windows 中的接口枚举代码不知何故未能包含链接本地地址。

如果您已经充分隔离了这个问题,我会向 PostgreSQL 发送错误报告以进一步分析该问题。

Note that the interface enumeration code that samehost and samenet 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

psql -d postgres -h 'fe80::xxxx:xxxx:xxxx:xxxx%eth0'

after setting listening_addresses and samenet 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.

寒冷纷飞旳雪 2024-11-26 05:53:02

我遇到了同样的问题,并通过关闭两台机器上的 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.

慕烟庭风 2024-11-26 05:53:02

您也可以

host      all        all       ::1/128       md5

用于本地主机。

You can also use

host      all        all       ::1/128       md5

for the localhost.

谜兔 2024-11-26 05:53:02

尽可能关闭适配器上的 IPV6。
之后,执行

netsh interface teredo set state disabled

此操作将禁用您无法从 GUI 中看到的虚拟网络接口。

Turn off IPV6 on adapters that you can.
After that, do

netsh interface teredo set state disabled

This will disable virtual network interfaces that you can't see from GUI.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文