【问题标题】:After pg_restore, an error; PG::ConnectionBad fe_sendauth: no password suppliedpg_restore 后,报错; PG::ConnectionBad fe_sendauth: 未提供密码
【发布时间】:2019-07-23 10:23:20
【问题描述】:

我刚刚使用 heroku 下载的数据库 (last.dump) 在我的本地数据库中完成了 pg_restore。现在我有一个错误; PG::ConnectionBad fe_sendauth:未提供密码。 我已经在 database.yml 中添加了用户名和密码,但什么也没有。 我必须做什么?

【问题讨论】:

    标签: ruby-on-rails database postgresql pgadmin


    【解决方案1】:

    我终于解决了在 database.yml 的通用配置部分添加“用户名:postgres”和“密码:***”;

    default: &default
      adapter: postgresql
      encoding: unicode
      # For details on connection pooling, see Rails configuration guide
      # http://guides.rubyonrails.org/configuring.html#database-pooling
      pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
      username: postgres
      password: ***
    

    不在开发部分;

     development:
      <<: *default
      database: CigBackCount_development
    
      # The specified database role being used to connect to postgres.
      # To create additional roles in postgres see `$ createuser --help`.
      # When left blank, postgres will use the default role. This is
      # the same name as the operating system user that initialized the database.
      #username: CigBackCount
    
      # The password associated with the postgres role (username).
      #password:
    

    更改后我重新加载了数据库;

    pg_ctl reload
    

    【讨论】:

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