bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 Database - 資料庫 PostgreSQL LOG: could not connect to Ident server
查看: 4797|回復: 0
go

LOG: could not connect to Ident server [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2009-11-13 14:15 |只看該作者 |倒序瀏覽 |打印
使用 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 的預設設定是
  1. # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
  2. # "local" is for Unix domain socket connections only
  3. local   all         all                               ident sameuser
  4. # IPv4 local connections:
  5. host    all         all         127.0.0.1/32          ident sameuser
  6. # IPv6 local connections:
  7. host    all         all         ::1/128               ident sameuser
複製代碼
因為 METHOD 都設定為 ident 所以會去找 Ident server 來處理
又剛好沒裝或沒啟動 Ident server 所以回應 Connection refused

關於  Ident server 可以安裝 oidentd 來用,不過具體的認證方式我還沒研究清楚
若是急著使用 PostgreSQL 可以先修改 pg_hba.conf 來解決
  1. # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
  2. # "local" is for Unix domain socket connections only
  3. local   all         all                               md5
  4. # IPv4 local connections:
  5. host    all         all         127.0.0.1/32          md5
  6. # IPv6 local connections:
  7. host    all         all         ::1/128               md5
複製代碼
記得 reload 或 restart  服務就可以登入了。

PS: Log 的英文錯誤訊息為
LOG: could not connect to Ident server at address "127.0.0.1", port 113: Connection refused
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2024-4-26 19:39 , Processed in 0.008952 second(s), 11 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.