Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set/reset password for PostgreSQL on Mac?

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?

like image 453
Louie Quicksell Avatar asked Oct 18 '25 02:10

Louie Quicksell


1 Answers

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.

like image 110
Winnerineast Lee Avatar answered Oct 20 '25 15:10

Winnerineast Lee