我正在尝试使用Padrino与Sequel和Postgres,但没有幸运的连接。
在我的pg_hba.conf中,我将postgres用户设置为“信任”,这样就不需要密码了(不需要密码就可以使用PgAdmin登录)。
# TYPE DATABASE USER ADDRESS METHOD
local all postgres trust我的Padrino连接如下所示:
Sequel::Model.plugin(:schema)
Sequel::Model.raise_on_save_failure = false # Do not throw exceptions on failure
Sequel::Model.db = case Padrino.env
when :development then Sequel.connect(:adapter=>'postgres', :host=>'localhost', :database=>'padrino_template_development', :user=>'postgres', :password=>'', :loggers => [logger])
when :production then Sequel.connect("postgres://localhost/padrino_template_production", :loggers => [logger])
when :test then Sequel.connect("postgres://localhost/padrino_template_test", :loggers => [logger])
end当我尝试运行rake任务sq:create时
我收到了这个消息
rake sq:create
=> Creating database 'padrino_template_development'
Password:
createdb: could not connect to database postgres: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"
<= sq:create executed我在这里做错了什么?
发布于 2013-11-09 23:09:31
好了,我在这里找到了答案,问题是我使用的PgAdmin3版本有一个bug,从1970年我更改密码时,这个bug使用户无效。
解决方案可以在here中找到
https://stackoverflow.com/questions/19874403
复制相似问题