0

I have just installed PostgreSQL 9.6.3 via homebrew(brew install postgresql) and am simply trying to run psql. However after entering:

Mac-Pro:~ Travis$ psql

It prompts me to enter a password, which I have never set. I've tried entering my system login password but receive:

Password: psql: FATAL: password authentication failed for user "Travis"

And when entering nothing I get: psql: fe_sendauth: no password supplied

Everything I've found online states there is no password set by default by postgres and yet this is requiring one and I've just installed it. No tutorial I've found mentions what to do if it prompts for password after install, they just jump right into working in postgres(usually creating users and settings passwords). What could this password be if I've never set it up and it's not my system password? And really what I want to know is, how can I get past this and use postgres?

Thank you

1 Answer 1

2

Your postgres installation is probably using ident authentication mechanism.

Please check if a user named postgres is created in your system. If yes, try to execute psql by switching to that user and see if it works.

Sign up to request clarification or add additional context in comments.

8 Comments

I did find the user postgres there, I had to reset the password for it but was able to login, however got an error mac os x needs to repair library to run applications I was still able to get to terminal and run psql but it did the exact same thing - prompted for password which I entered the new system password I just set up for postgres and it still says password authentication failed.
Could you please check the auth-method in your pg_hba.conf file? Changing it to trust and restarting postgres should allow all logins without prompting password if that's what you are looking for.
It appears the method is already set to trust. When I open pg_hba.conf and scroll all the way to the bottom I see a sort of table with columns TYPE, DATABASE, USER, ADDRESS, METHOD. Under method lists trust 6 times, there are no other values under METHOD. Is there a row I should add there?
okay I added the line local all all trust at the bottom and restarted postgres but both psql and psql -U postgres are still prompting for password.
Okay I added that line at the bottom as well, it did not exist before. Same issue though. No worries at all I really appreciate your help. I can't believe how difficult this is just to set up! Everything I read online it seems that once installed it's pretty much good to go, it's frustrating that mine is apparently configured differently right out of the box.
|

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.