pg Admin 4 – password for “postgres” user when trying to connect to PostgreSQL 13 server

I ran into the same problem recently. The solution below works for me. I’m using Windows btw, so you should try equivalent commands in your OS.

  1. Change METHOD of all rows in your pg_hba.conf file from scram-sha-256 to trust
  2. Add bin folder of Postgres installation to path, if you haven’t
  3. Open command prompt and enter psql -U postgres. You won’t be asked for password here.
  4. Enter \password postgres
  5. Choose and confirm your password
  6. Revert pg_hba.conf to original state

Now you should be able to enter password for postgres in pgAdmin.

Leave a Comment