【问题标题】:`initialize': fe_sendauth: no password supplied (PG::ConnectionBad)`initialize': fe_sendauth: 没有提供密码 (PG::ConnectionBad)
【发布时间】:2016-10-15 13:51:07
【问题描述】:

我是 postgresql 的新手。我正在尝试将 postgresql 与 ruby​​ on rails 一起使用。我刚刚安装了 postgresql,并且刚刚创建了我的数据库。但是当我尝试在 localhost 的 5432 端口上运行 postgresql 时,出现上述错误。

【问题讨论】:

  • 如果你想你可以通过输入trust而不是peer来允许没有密码的本地主机连接

标签: ruby-on-rails postgresql rails-postgresql


【解决方案1】:

是的,我想出了解决办法:

我将pg_hba.conf中的设置更改为

# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

最初不是trust,而是md5。 然后只是做service postgresql restrart 就行了!!

【讨论】:

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