【发布时间】:2017-09-07 01:09:48
【问题描述】:
当我尝试在命令行中运行 psql 时,它会要求 Password: 。
我不太确定用户名和密码是什么。
我通过brew install postgres安装了postgresql
pg_hba.conf
# the database superuser. If you do not trust all your local users,
# use another authentication method.
# TYPE DATABASE USER 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 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication AustinTruong trust
#host replication AustinTruong 127.0.0.1/32 trust
#host replication AustinTruong ::1/128 trust
如果我的问题有任何混淆,请告诉我。
编辑
在其他帖子中,它提到如果我将 pg_hba.conf 文件更改为 local all all trust,我不应该需要密码。但它仍然要求输入密码。
我已经按照Postgresql: password authentication failed for user "postgres" 的步骤进行操作,但我仍然遇到同样的问题。我添加了一行
local all postgres ident
【问题讨论】:
标签: postgresql