0

When i try to make postgres work with Rails.

FATAL: Peer authentication failed for user "postgres"

i have 9.6 version and 9.5 postgresql i remember i created a user called postgresql

for connect with it i do first:
sudo su
su - postgres
psql
\l

My users: http://pastebin.com/kKH4qjsr Here's my pg_hba.conf : http://pastebin.com/VnxbQCDW i put in my project postgres but i cannot connect

6
  • Hi and welcome to Stack Overflow. Here we like our questions to live forever - and pastebins come and go like snowflakes... can you please edit your question and add the details into your original question, so that it will live on and on (we like this in case other people come across the same problem in future)? On top of this - please add any relevant code to your question. What you have tried to do to fix the error. any error messages you got etc Commented Oct 17, 2016 at 22:58
  • Can you add a print out of the posgres users and their permissions see here unix.stackexchange.com/questions/201666/… Commented Oct 17, 2016 at 22:59
  • show this : psql -U postgres psql: FATAL: Peer authentication failed for user "postgres", then i've ti di sudo su for connect with the root, su - postgres, psql i followed your link @CdotStrifeVII pastebin.com/bMWUWB3w Commented Oct 17, 2016 at 23:24
  • So I am not a pg expert, but I have run into this issue before. One more thing what exactly are you doing that is causing this error I don't know what you mean by trying to make pg work with rails. Also it just sounds like you need to create a user name postgres. Commented Oct 17, 2016 at 23:46
  • imgur.com/a/d7k4F Commented Oct 18, 2016 at 0:01

1 Answer 1

0

In your pg_hba.conf file, use the trust auth method instead of md5:

# IPv4 local connections:

host    all             all             127.0.0.1/32            trust
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.