【发布时间】:2020-08-07 10:11:59
【问题描述】:
我知道类似的问题已经被问了大约 2000 次,但到目前为止我找到的答案都没有帮助我。
所以我可以通过 SSH 隧道通过 PGAdmin 连接到我的数据库,我也可以使用su - postgres psql,但是当我使用su - postgres 和psql -U postgres -h localhost 之类的东西时,我收到错误FATAL: Ident authentication failed for user "postgres"。
当我尝试使用我的 python 脚本连接到数据库时,也会发生同样的事情。
当然,我尝试以多种方式编辑我的pg_hba.conf 文件,将所有内容设置为trust、password 或md5。每次都说同样的话。
目前我的pg_hba.conf 看起来像这样:
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
是的,我确实在更改之间重新启动了服务器。我不知道这里可能是什么问题,非常感谢任何帮助!
【问题讨论】:
标签: postgresql centos7