2014-09-22 109 views
1

這是我的database.ymlPostgreSQL的認證失敗

development: 
    adapter: postgresql 
    database: myUsername 
    username: myUsername 
    password: myPassword 
    host: localhost 

所以,當我去我的本地網頁,顯示沒有錯誤。如果我在database.yml中更改密碼的東西不正確,我得到

PG::ConnectionBad: FATAL: password authentication failed for user "myUsername" FATAL: password authentication failed for user "myUsername" 

錯誤。因此,我的密碼是正確的。

但儘管如此,當我運行

rake db:migrate 

我得到的錯誤不管我的密碼是對還是錯。如果它是正確的,我得到以下錯誤:

PG::ConnectionBad: fe_sendauth: no password supplied 

如果這是錯的,我得到了同樣的錯誤我本地的網頁上:

PG::ConnectionBad: FATAL: password authentication failed for user "myUsername" FATAL: password authentication failed for user "myUsername" 

是什麼原因導致它認爲正確的密碼是「不供應「?請任何幫助或信息表示讚賞,我已經搞了兩天了。

回答

0
  1. 編輯的pg_hba.conf通過的geditroot用戶通過改變MD5信任,看到這裏empty, uneditable pg_hba.conf file可能出現的一些問題
  2. 須藤服務的PostgreSQL重啓
  3. 重新啓動本地服務器

如果你的密碼符合用戶名,這應該可以工作。