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
    – Taryn East
    Oct 17 '16 at 22:58
  • Can you add a print out of the posgres users and their permissions see here unix.stackexchange.com/questions/201666/… Oct 17 '16 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
    – ito2307ht
    Oct 17 '16 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. Oct 17 '16 at 23:46
  • imgur.com/a/d7k4F
    – ito2307ht
    Oct 18 '16 at 0:01
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.