- Edit the pg_hba.conf file
- sudo vi /Library/PostgreSQL/9.2/data/pg_hba.conf
- Change the "md5" method for all users to "trust" near the bottom of the file
- Find the name of the service
- ls /Library/LaunchDaemons
- Look for postgresql
- Stop the postgresql service
- sudo launchctl stop com.edb.launchd.postgresql-9.2
- Start the postgresql service
- sudo launchctl start com.edb.launchd.postgresql-9.2
- Start psql session as postgres
- psql -U postgres
- (shouldn't ask for password because of 'trust' setting)
- Reset password in psql session by typing
- ALTER USER postgres with password 'secure-new-password';
- \q
- enter
- Edit the pg_hba.conf file
- Switch it back to 'md5'
- Restart services again
Monday, December 2, 2013
Resetting PostgreSQL 'postgres' user password in Mac
Subscribe to:
Posts (Atom)