4

I'm trying to set up PostgreSQL on Mac, and having some difficulty figuring out my password. I used homebrew to install with brew install postgresql, which appears to have executed correctly. When I try to start postgreSQL with psql postgres I am prompted to enter the password for my user account. I never actually set up a password, and my general user account password fails the password authentication. Same with sudo psql postgres.

I checked to see if I could change the pg_hba.conf file, but the file either doesn't exist or is not located at /var/lib/postgres/data/pg_hba.conf. Any thoughts on how to reset my password?

2
  • Does this answer your question? How to change PostgreSQL user password? Commented Oct 30, 2019 at 19:37
  • You may be connecting to your macs pre-installed version of postgresql, which you'll need to sudo/su to in order to connect to. Commented Oct 30, 2019 at 21:44

2 Answers 2

2

In Homebrew 2.5.7 the installation of postgresql is at /usr/local/Cellar/postgresql and the configuration file is at /usr/local/var/postgres/pg_hba.conf.

Sign up to request clarification or add additional context in comments.

Comments

1

In Homebrew 4.1.5 the config file is in

/opt/homebrew/var/postgresql@<version>

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.