我正在嘗試在我的作業桌面上使用 PostgreSQL (Windows 10)。安裝時,一切正常,我為默認的 postgres 用戶設定了密碼。
在 PowerShell 上使用psql -U postgres時,它會在提示我輸入密碼之前拋出此錯誤訊息:
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "postgres"
在pg_hba.conf檔案中,所有METHOD值都設定為scram-sha-256. 更改為md5并password沒有幫助。它只有在我將其更改為 時才有效trust,但我想要一個密碼。我怎樣才能解決這個問題?
uj5u.com熱心網友回復:
添加 -W 標志以強制提示輸入密碼 https://www.postgresql.org/docs/devel/app-psql.html
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/536254.html
