我在centos上设置了posgresql。我试图访问它,但收到错误:
sudo -u postgres psql -c "ALTER USER john WITH PASSWORD 'mypass';"
[sudo] password for john:
could not change directory to "/home/john"
ALTER ROLE
psql -h localhost -U john -d proddb -W
Password for user john:
psql: FATAL: Ident authentication failed for user "john"
我已将用户列为' du'并且知道约翰是超级用户。 有人能告诉我为什么会这样,以及如何解决它?
答案 0 :(得分:1)
我将 ident 替换为 pg_hba.conf 中的密码,然后重新启动了postgres服务,现在它可以运行了。 ident选项使用系统凭据,而密码是'选项将使用未加密的密码。