[英]psql: FATAL: password authentication failed
當我嘗試在命令行中運行 psql 時,它要求輸入Password:
。
我不太確定用戶名和密碼是什么。
我通過brew install postgres
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
如果要從自己的操作系統帳戶創建新的數據庫帳戶,請使用:
/usr/local/bin/createdb someusername
看看這是否有效。 另外這個其他SO問題可能會有所幫助。
編輯:
使用brew info postgres
獲取有關您的版本的更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.