【问题标题】:rake aborted! PG::ConnectionBad: fe_sendauth: no password supplied耙中止! PG::ConnectionBad: fe_sendauth: 未提供密码
【发布时间】:2019-05-18 12:45:06
【问题描述】:

我无法执行 rake db:migrate。

我尝试更改 pg_hba.conf md5 -> 信任,但这对我没有帮助,因为我收到了新的信任错误:

rake aborted!
PG::ConnectionBad: ▒▒▒▒▒:  ▒▒▒▒ "roman" ▒▒ ▒▒▒▒▒▒▒▒▒▒

我不知道这是什么意思。 我尝试在 Windows 10 上使用 postgresql 服务器(pgAdmin4、postgresql11、最新版本的 rails 和 ruby​​)在 ruby​​ on rails 上创建简单的应用程序。

我的数据库.yml

default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: simpleblog
  password: <%= ENV['SIMPLEBLOG_DATABASE_PASSWORD'] %>

development:
  <<: *default
  database: simpleblog_development

test:
  <<: *default
  database: simpleblog_test

production:
  <<: *default
  database: simpleblog_production

我的 pg_hba.conf

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
host    replication     all             127.0.0.1/32           md5
host    replication     all             ::1/128                md5

所以我得到...首先

rake aborted!
PG::ConnectionBad: fe_sendauth: no password supplied

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

然后当我更改 md5 -> 信任

rake aborted!
PG::ConnectionBad: ▒▒▒▒▒:  ▒▒▒▒ "roman" ▒▒ ▒▒▒▒▒▒▒▒▒▒

【问题讨论】:

  • 您在将其设置为信任之前显示了 pg_hba.conf,但之后没有。也显示之后的版本。

标签: ruby-on-rails postgresql


【解决方案1】:

检查 application.yml 中的“SIMPLEBLOG_DATABASE_PASSWORD=something”

【讨论】:

    猜你喜欢
    • 2015-12-17
    • 2014-06-16
    • 1970-01-01
    • 1970-01-01
    • 2019-04-25
    • 1970-01-01
    • 2019-07-23
    • 2016-10-15
    • 1970-01-01
    相关资源
    最近更新 更多