LOG: could not connect to Ident server
使用 Postgresql 8.3 版在完成全新的安裝後,新增一個帳號並設好密碼後進行登入卻出現下列錯誤訊息:psql: 嚴重錯誤: Ident驗證使用者"dba"失敗
檢查 log 發現有下列兩行訊息:
LOG: could not connect to Ident server at address "127.0.0.1", port 113: 連線被拒絕
嚴重錯誤: Ident驗證使用者"dba"失敗
這是因為 pg_hba.conf 的預設設定是[code]
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident sameuser
# IPv4 local connections:
host all all 127.0.0.1/32 ident sameuser
# IPv6 local connections:
host all all ::1/128 ident sameuser
[/code]因為 METHOD 都設定為 ident 所以會去找 Ident server 來處理
又剛好沒裝或沒啟動 Ident server 所以回應 Connection refused
關於 Ident server 可以安裝 oidentd 來用,不過具體的認證方式我還沒研究清楚
若是急著使用 PostgreSQL 可以先修改 pg_hba.conf 來解決[code]
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
[/code]記得 reload 或 restart 服務就可以登入了。
PS: Log 的英文錯誤訊息為
LOG: could not connect to Ident server at address "127.0.0.1", port 113: Connection refused
頁:
[1]