嗨,我正在使用 postgresql。
我的
Postgres User : postgres
Passwprd : abc123
但是当我输入root@xxxx:~#psql -U postgres -W
它说
root@xxxx:~# Ident authentication failed for user "root"
但是当我su postgres cd
然后键入以下命令时
#psql -U postgres -W
它工作正常,我可以访问所有数据库。
当我尝试访问我的网站时,它给了我 posstgres 错误日志中的错误
password authentication failed for user "postgres"
为什么会发生这种情况,请帮助我,提前谢谢
更新
我的pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres trust
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 md5