How to find user name and password for PostgresSQL on mac? I did not remember that I have set a password and username. How to find the default username and password on mac?
CodePudding user response:
To log in without a password:
sudo -u postgres psql postgres
To know the username
\du
To reset the password:
ALTER USER user_name WITH PASSWORD 'new_password';
replace user_name
with your username you found by \du
command