用户的对等身份验证失败

时间:2020-06-15 03:15:52

标签: ruby-on-rails postgresql-12

我在ubuntu台式机20.04LTS上使用带ruby 2.7和rails 6.0.3的PostgreSQL-12

每当我尝试rails db:create时,都会出现以下错误

FATAL: Peer authentication failed for user "postgres" Couldn't create the 'myap_development' database. Please check your configuration. rails aborted! ActiveRecord::NoDatabaseError: FATAL: Peer authentication failed for user "postgres"

我一直在将 pg_hba.conf 中的方法从 peer 调整为 md5 trust ,徒劳无功 我的 database.yml 配置也是准确的。

databse.yml

default: &default
  adapter: postgresql
  encoding: unicode
  username: postgres
  port: 5432
  password: postgres

  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
  <<: *default
  database: myap_development

1 个答案:

答案 0 :(得分:0)

启动数据库服务器

# 1..10 | %{ 1..$_ |  Reduce-Object { $a * $b } }
1
2
6
24
120
720
5040
40320
362880
3628800