postgresql登录失败的解决方法-创新互联

创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!

创新互联公司专注于双辽网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供双辽营销型网站建设,双辽网站制作、双辽网页设计、双辽网站官网定制、小程序开发服务,打造双辽网络公司原创品牌,更为您提供双辽网站排名全网营销落地服务。

小编给大家分享一下postgresql登录失败的解决方法,相信大部分人都还不怎么了解,因此分享这边文章给大家学习,希望大家阅读完这篇文章后大所收获,下面让我们一起去学习方法吧!

postgresql登录失败的解决方法:

1.确认phpPgAdmin是否可以链接到postgresql数据库,方法:查看data/pg_log下的log有没有phpPgAdmin的访问记录,有则说明可以链接。

以下为出错信息:

 LOG:  provided username (postgres) and authenticated username (apache) don't match
   FATAL:  Ident authentication failed for user "postgres"

2.查看postgresql的认证方法:pg_hba.conf

# "local" is for Unix domain socket connections only
local   all         all                               ident
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

看着好像跟ident认证方式有点关系,最后在官方文档找到一句话:

When using an external authentication system like Ident or GSSAPI, the name of the operating system 
user that 
initiated the connection might not be the same as the database user he needs to connect as.

明白了,原来上面的[local   all         all          ident]搞的鬼,如果是ident的话需要配置 pg_ident.conf文件,所以果断换成除以上两种加密方式外的方法

重启postgresql:#service postgresql restart.再访问一次,成功。

以上是postgresql登录失败的解决方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联-成都网站建设公司行业资讯频道!


名称栏目:postgresql登录失败的解决方法-创新互联
转载来源:http://pwwzsj.com/article/dsdeih.html