Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres 11 default password (homebrew)

Tags:

postgresql

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.

like image 810
Jethro Avatar asked Jul 03 '26 19:07

Jethro


2 Answers

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

psql -h localhost -d postgres
like image 194
wessel Avatar answered Jul 05 '26 08:07

wessel


  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
like image 33
Hechi Avatar answered Jul 05 '26 10:07

Hechi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!