【问题标题】:Accessing a Postgres Db - Ident authentication failed [duplicate]访问 Postgres Db - Ident 身份验证失败 [重复]
【发布时间】:2015-07-04 06:41:51
【问题描述】:

我在 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”的用户,并且知道 john 是超级用户。 谁能告诉我为什么会发生这种情况以及如何解决?

【问题讨论】:

  • 是的。这是同一个问题。但是,在之前的帖子中,答案并不清楚。我已经在直截了当的回答中明确了问题所在。如果您是管理员,则可以继续将我的答案移至该帖子并关闭此帖子。

标签: postgresql


【解决方案1】:

我在 pg_hba.conf 中将 ident 替换为 password,然后重新启动 postgres 服务,现在它可以工作了。 ident 选项使用系统凭据,而 'password' 选项将使用未加密的密码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-09
    • 2015-11-25
    • 1970-01-01
    • 1970-01-01
    • 2014-07-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多