Postgres pgAdmin III访问数据库被拒绝 [英] Postgres pgAdmin III Access to Database Denied

查看:1290
本文介绍了Postgres pgAdmin III访问数据库被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试连接到我的服务器上的Postgres实例时,我收到以下错误。

I get the following error when attempting to connect to the Postgres instance on my server.

访问数据库被拒绝
服务器不授予访问数据库的权限:服务器报告
FATAL:no pg_hba.conf主机fe80 :: 2d93:af94:879c:4fa%12,用户postgres,数据库postgres,SSL关闭

Access to database denied The server doesn't grant access to the database: the server reports FATAL: no pg_hba.conf entry for host "fe80::2d93:af94:879c:4fa%12", user "postgres", database "postgres", SSL off

I尝试了这里提供的三个明显的解决方案。也就是说,我尝试Syed Aslam解决方案中找到的^链接。

I have tried the three obvious solutions found HERE. Namely I attempted Syed Aslam solution found in that^ link.

我测试,我正在重新启动服务,通过删除一些配置来打破我的本地pgAdmin III连接。我已经检查我的防火墙是否通过暂时关闭它来阻止连接。

I tested that I was restarting the service correctly by removing some config to break my local pgAdmin III connection. I have checked if my firewall was blocking the connection by temporarily turning it off.

任何人都可以帮我找出为什么会收到这个错误?

Can anyone help me figure out why I am getting this error?

Postgres 9.4.1

pgadmin III版本1.20

Windows Server 2012(主机)

Windows 7(尝试从此连接到主机)

Postgres 9.4.1
pgadmin III version 1.20
Windows Server 2012 (host)
Windows 7 (trying to connect from this to the host)

推荐答案

原来我有一个IPv4作为IP地址在我的pg_hba.conf条目。将其更改为如下所示的IPv6版本后:

It turns out that I had an IPv4 as the IP address in my entry for the pg_hba.conf. After changing it to an IPv6 version like this:

IPv4 = 0.0.0.0/0
IPv6 = :: / 0

IPv4 = 0.0.0.0/0 IPv6 = ::/0

这一切都按我预期的工作。来自user_0的评论和此处的文档为我清除它。

It all worked as I would have expected. The comment from user_0 and the documentation found HERE cleared it up for me.

显然,如果你使用IPv6,应该使用IPv4时,答案是相反的。

Obviously the answer works in reverse if you're using an IPv6 when you should be using an IPv4.

这篇关于Postgres pgAdmin III访问数据库被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆