2014-09-22 110 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. 重新启动本地服务器

如果你的密码符合用户名,这应该可以工作。