8

Various guides show how to install/start postgres on mac using brew:

brew install postgresql
brew services start postgresql

However the usual next step, to connect with an empty password, fails.

psql postgres
Password for user <>:
psql: fe_sendauth: no password supplied

How do you connect to a newly created postgres 11 database on mac in 2019?


Prior research:

It looks like the default password used to be empty.

The official wiki guide, and Recent/fairly recent tutorials suggest psql<databasename> should just work, but these fail with the above errors.

An older guide and newer SO answer have you switch user before using psql, which gives the same error as above.

2
  • 1
    Note the official wiki seems to have a typo: i'm replacing pgsql with psql. The recent guide inclused creating a database as a step, and instead fails with createdb: could not connect to database template1: FATAL: password authentication failed for user. The service is always started after installing: brew services start postgresql Service `postgresql` already started, use `brew services restart postgresql` to restart. Commented Aug 21, 2019 at 15:10
  • still not answered... yikes. I don't know if it will help now but you could try adding tags such as your operating system or brew to bring it to a wider pool of potential answerers Commented Jun 4, 2020 at 20:29

2 Answers 2

1

I had the same problem with a brew installed Postgres@14. The following got me into the DB shell:

psql -h localhost -d postgres
Sign up to request clarification or add additional context in comments.

Comments

1
  1. login on your machine in a shell as „root“

  2. change to the „postgres“ user (no password required because you are root):

$ su - postgres
  1. run psql
$ psql

Comments

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.