0

I'm on Mac. I installed postgres with brew postgresql.

When I type in psql postgres, it serves

Password for user [myuser]:

And when I give it the password, it says

psql: FATAL: password authentication failed for user "[myuser]"

But I know that I'm giving it the right password.

goollan
  • 765
  • 8
  • 19
  • `I know that I'm giving it the right password`: Do you, though? What I do in cases like this is, type the password in a plaintext editor, then select and copy it, and paste it in the password prompt. Not the most elegant solution, but it should work. That way you can rule out typos. – grooveplex Apr 27 '19 at 02:48
  • Yup, I am absolutely certain it is the right password. – goollan Apr 27 '19 at 02:49
  • The value it has for [myuser] is the name of my Mac user. It's the right password for my Mac user. – goollan Apr 27 '19 at 02:49
  • 2
    Try typing `psql postgres postgres` – zedfoxus Apr 27 '19 at 02:51
  • It says [here](https://stackoverflow.com/questions/46781471/why-postgresql-on-mac-asks-me-for-password-after-fresh-install) that the default credentials are username `postgres`, password `postgres`. – grooveplex Apr 27 '19 at 02:51
  • That did it, thanks – goollan Apr 27 '19 at 02:53

1 Answers1

1

I had the same problem and it turns out when I run psql shell it runs version 12 by default and when I went to the file location (right click on the psql shell and view location) I went to the version 13 (the version that I installed, replace it with the version that you installed) file and run psql shell and the password worked, I hope this helps.

Hashim
  • 11
  • 1
  • 2