PG::ConnectionBad: FATAL: Ident authentication failed for user "rails_dev"

Ahmed Said

When I run rails db:setup, I get this error message:

FATAL: Ident authentication failed for user "rails_dev"
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"myapp_test", "username"=>"rails_dev", "password"=>"aqwe123", "host"=>"localhost", "port"=>5432}
rails aborted!

PG::ConnectionBad: FATAL: Ident authentication failed for user "rails_dev"
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in 'initialize'
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in 'new'
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in 'connect

Ahmed Said

After long search, I found the solution; the issue was in the PostgreSQL configuration file pg_hba.conf. I changed the ident method to MD5 and it worked.

local   all             all                                     MD5
host    all             all             127.0.0.1/32            MD5
host    all             all             ::1/128                 MD5

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PG::ConnectionBad: FATAL: password authentication failed for user "alphauser"

From Dev

Rails 5 in prod: PG::ConnectionBad: FATAL: password authentication failed for user "postgres" with Docker

From Dev

psql: FATAL: Ident authentication failed for user "xxx" with method trust

From Dev

error: Ident authentication failed for user

From Dev

postgres ident authentication failed

From Dev

Ident Authentication failed for user Centos 8 Postgresql12

From Dev

Ident authentication fault for user

From Dev

PostgreSQL: MD5 Authentication in pg_hba.conf gives me FATAL: Peer authentication failed for user "postgres"

From Dev

PG::ConnectionBad FATAL: role "Myname" does not exist

From Dev

PG::ConnectionBad FATAL: role "Myname" does not exist

From Java

psql: FATAL: Peer authentication failed for user "dev"

From Dev

FATAL: password authentication failed for user "postgres"

From Dev

psql: FATAL: PAM authentication failed for user

From Dev

FATAL: Peer authentication failed for user "rails"

From Dev

FATAL: Peer authentication failed for user "shop"

From Dev

PostgreSQL SSPI authentication - FATAL: 2801: password authentication failed for user "xxx"

From Dev

PG::ConnectionBad FATAL: role "BetBook3" is not permitted to log in

From Dev

Ident authentication failed on PostgreSQL through SSH tunnel

From Java

FATAL: password authentication failed for user "postgres" (postgresql 11 with pgAdmin 4)

From Dev

Fatal! Authentication for user postgres failed, multiples OS, nothing work

From Dev

psql: FATAL: password authentication failed for user windows 8

From Dev

Redshift connection issue: FATAL: password authentication failed for user

From Dev

FATAL: password authentication failed for user "postgres" Ubuntu v20.10

From Dev

fatal: Authentication failed Git Bash

From Dev

Fatal: authentication failed for [GIT client]

From Dev

Ident authentication failed error when connecting to PostgreSQL via PgAdmin III

From Dev

Docker - PG::ConnectionBad

From Dev

PG::ConnectionBad error

From Dev

Ruby TCP server - ERROR:PG::ConnectionBad: FATAL: remaining connection slots are reserved for non-replication superuser connections

Related Related

  1. 1

    PG::ConnectionBad: FATAL: password authentication failed for user "alphauser"

  2. 2

    Rails 5 in prod: PG::ConnectionBad: FATAL: password authentication failed for user "postgres" with Docker

  3. 3

    psql: FATAL: Ident authentication failed for user "xxx" with method trust

  4. 4

    error: Ident authentication failed for user

  5. 5

    postgres ident authentication failed

  6. 6

    Ident Authentication failed for user Centos 8 Postgresql12

  7. 7

    Ident authentication fault for user

  8. 8

    PostgreSQL: MD5 Authentication in pg_hba.conf gives me FATAL: Peer authentication failed for user "postgres"

  9. 9

    PG::ConnectionBad FATAL: role "Myname" does not exist

  10. 10

    PG::ConnectionBad FATAL: role "Myname" does not exist

  11. 11

    psql: FATAL: Peer authentication failed for user "dev"

  12. 12

    FATAL: password authentication failed for user "postgres"

  13. 13

    psql: FATAL: PAM authentication failed for user

  14. 14

    FATAL: Peer authentication failed for user "rails"

  15. 15

    FATAL: Peer authentication failed for user "shop"

  16. 16

    PostgreSQL SSPI authentication - FATAL: 2801: password authentication failed for user "xxx"

  17. 17

    PG::ConnectionBad FATAL: role "BetBook3" is not permitted to log in

  18. 18

    Ident authentication failed on PostgreSQL through SSH tunnel

  19. 19

    FATAL: password authentication failed for user "postgres" (postgresql 11 with pgAdmin 4)

  20. 20

    Fatal! Authentication for user postgres failed, multiples OS, nothing work

  21. 21

    psql: FATAL: password authentication failed for user windows 8

  22. 22

    Redshift connection issue: FATAL: password authentication failed for user

  23. 23

    FATAL: password authentication failed for user "postgres" Ubuntu v20.10

  24. 24

    fatal: Authentication failed Git Bash

  25. 25

    Fatal: authentication failed for [GIT client]

  26. 26

    Ident authentication failed error when connecting to PostgreSQL via PgAdmin III

  27. 27

    Docker - PG::ConnectionBad

  28. 28

    PG::ConnectionBad error

  29. 29

    Ruby TCP server - ERROR:PG::ConnectionBad: FATAL: remaining connection slots are reserved for non-replication superuser connections

HotTag

Archive