0
如何配置PostgreSQL以允許默認的postgres用戶無需本地主機密碼即可登錄?如何讓本地連接無需密碼提示postgres登錄?
有幾個類似的問題,如this和this,但沒有任何修改pg_hba.conf
的建議已爲我工作。不過,根據我對pg_hba.conf
規則的理解,我應該可以通過peer
或trust
選項來完成此操作。
我試圖運行像這樣的命令:如果我嘗試這條線在我pg_hba.conf
sudo psql --user=postgres --no-password --command="blah;" -h 127.0.0.1
:
local all postgres trust
我的命令失敗,出現錯誤:
psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "postgres", database "postgres", SSL on
FATAL: no pg_hba.conf entry for host "127.0.0.1", user "postgres", database "postgres", SSL off
如果我試過這一行:
local all postgres peer
我的命令失敗並出現相同的錯誤。
我該如何解決這個問題?