0

I want to run postgres on mac and downloaded pg admin 4. When I try to connect to server it says authentication failed for user "postgres" on mac. What's happening? I didn't set any password for user postgres. And there's no default one as I understand.

Please give simple step-by-step explanation for beginners. If you say something like "Check pg_hba.conf. it should have a line like this at the top" - please specify where exactly I should find this file on mac, as it's not obvious.

jarlh
  • 42,561
  • 8
  • 45
  • 63
Timur
  • 77
  • 6
  • Nowhere near enough information. Add to question the answers to: 1) Postgres version? 2) Where you downloaded it from? 3) What are the connection parameters you are using? 4) Are trying to connect with pgAmin4 or another client? 5) If with pgAdmin4 have you tried with another client e.g. psql? – Adrian Klaver Sep 05 '21 at 15:37
  • Macs have tools for finding files. We don't know where your unspecified installer might have installed it. And what is the *complete* error message? – jjanes Sep 05 '21 at 15:45

2 Answers2

0

first you write master password (your own password that you set) then when you want to connect to the server you have to write password for postgres, i wrote the word "password" and it worked. In PostgreSql 15.

-2

your information isn't enough to determined what to answer. like others said, which postgresql version you install, from where you installed it, how you installed it. But for general answers :

  1. postgresql create a default user as administrative role with the id : postgres without any password so after entering the username just login without entering any password, or for some version the password is also postgres

  2. When installing on a mac via homebrew, the default user that is created is named the same as your mac's user account. There is no password, and running psql should get you in. reference to this user and pass issues with homebrew

  3. make sure are you really just have 1 postgresql installed? maybe you have other apps running their own postgresql db. it happens sometime

  4. Maybe this link could help recover postgres password - broadcom

  5. I found your question is similar tho this one password authentification failed for postgres

  6. try to remember the first time you open pgadmin, it should prompt you with master password creation. refer to this documentation from pgadmin master password

first thing first please elaborate more when you face a problem so others may help you with the correct answer. also please crosscheck my answer if it helpful or not.

net_navi
  • 27
  • 5
  • Thanks for replying. I have several problems with that. No password or postgres as a password doesn't work. In many threads like this and in the link you gave the advice is to change pg_hba.conf file. But where to find it? Some people say it's in the Library/Postgres13. But in my Library folder I don't have Postgres13 (even though I installed it) – Timur Sep 16 '21 at 22:20
  • it should be in the data directory where your postgres installation is located like this /Postgresql/13/data/pga_hba.conf – net_navi Sep 17 '21 at 04:35
  • if its solved please mark as solved and up vote the answer. – net_navi Apr 01 '22 at 03:13