Postgres issue

18 views
Skip to first unread message

Piyush Chowhan

unread,
Aug 7, 2018, 1:59:22 AM8/7/18
to Ruby on Rails: Talk
FATAL:  Peer authentication failed for user "admin"
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"bookingsaround_diy_development", "username"=>"admin", "password"=>"password"}
rake aborted!
PG::ConnectionBad: FATAL:  Peer authentication failed for user "admin"

Tasks: TOP => db:create

Any help

Not able run rake db:setup command failing to run.

Mike

unread,
Aug 7, 2018, 4:00:45 AM8/7/18
to Ruby on Rails: Talk
Peer Authentication used your OS username and password for access, you may need to change pg_hba.conf and change instances of peer to md5.

This also assumes that the user has been created correctly in the PostgreSQL system.

It may also help to use the lines

host: localhost
port: 5432

In your database.yaml

Hassan Schroeder

unread,
Aug 7, 2018, 10:29:07 AM8/7/18
to rubyonrails-talk
On Mon, Aug 6, 2018 at 10:59 PM, Piyush Chowhan
<peyushc...@gmail.com> wrote:
> FATAL: Peer authentication failed for user "admin"
> Couldn't create database for {"adapter"=>"postgresql",
> "encoding"=>"unicode", "database"=>"bookingsaround_diy_development",
> "username"=>"admin", "password"=>"password"}
> rake aborted!
> PG::ConnectionBad: FATAL: Peer authentication failed for user "admin"

> Any help

Have you tried logging in from a shell with those credentials?

Did you really intend to use peer auth on your system? Postgres
offers a variety of authentication schemes; "trust" might be more
appropriate for dev work, but up to you.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Piyush Chowhan

unread,
Aug 7, 2018, 10:45:45 AM8/7/18
to rubyonra...@googlegroups.com
Ya, I have tried with the login from the shell which I have given in the database.yml file.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAptYOP9F%2BSA-355%3D1Xaioj1yrMOzy0vr314k4R0MUwSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks & Regards
Piyush Chowhan

Khizer Mehdi

unread,
Aug 8, 2018, 8:17:17 AM8/8/18
to rubyonra...@googlegroups.com
Piyush,

As Mike suggested, can you set host,port setting  explicitly  in database.yml and 
can you re run rake db:create

On Tue 7 Aug, 2018, 8:15 PM Piyush Chowhan, <peyushc...@gmail.com> wrote:
Ya, I have tried with the login from the shell which I have given in the database.yml file.
On Tue, Aug 7, 2018 at 7:58 PM, Hassan Schroeder <hassan.s...@gmail.com> wrote:
On Mon, Aug 6, 2018 at 10:59 PM, Piyush Chowhan
<peyushc...@gmail.com> wrote:
> FATAL:  Peer authentication failed for user "admin"
> Couldn't create database for {"adapter"=>"postgresql",
> "encoding"=>"unicode", "database"=>"bookingsaround_diy_development",
> "username"=>"admin", "password"=>"password"}
> rake aborted!
> PG::ConnectionBad: FATAL:  Peer authentication failed for user "admin"

> Any help

Have you tried logging in from a shell with those credentials?

Did you really intend to use peer auth on your system? Postgres
offers a variety of authentication schemes; "trust" might be more
appropriate for dev work, but up to you.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.



--
Thanks & Regards
Piyush Chowhan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACL5WfZph74YVLCpWDJ1ibwvhMukRkmKyO__3Vob4pnOLZKErg%40mail.gmail.com.

Piyush Chowhan

unread,
Aug 9, 2018, 2:08:50 AM8/9/18
to Ruby on Rails: Talk

In terminal I have created a role user and password what I have given in database.yml file by this command below and I solved the problem. Thanks for your reply.
psql -U postgres ------ run console

CREATE ROLE XXXX WITH LOGIN SUPERUSER PASSWORD 'XXXXX'; ------- to create a role
Reply all
Reply to author
Forward
0 new messages