首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法通过Sequel连接到Postgres

无法通过Sequel连接到Postgres
EN

Stack Overflow用户
提问于 2013-11-09 17:26:32
回答 1查看 442关注 0票数 3

我正在尝试使用Padrino与Sequel和Postgres,但没有幸运的连接。

在我的pg_hba.conf中,我将postgres用户设置为“信任”,这样就不需要密码了(不需要密码就可以使用PgAdmin登录)。

代码语言:javascript
复制
# TYPE  DATABASE        USER            ADDRESS                 METHOD
  local all             postgres                                trust

我的Padrino连接如下所示:

代码语言:javascript
复制
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

我收到了这个消息

代码语言:javascript
复制
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

我在这里做错了什么?

EN

回答 1

Stack Overflow用户

发布于 2013-11-09 23:09:31

好了,我在这里找到了答案,问题是我使用的PgAdmin3版本有一个bug,从1970年我更改密码时,这个bug使用户无效。

解决方案可以在here中找到

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19874403

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档