简体   繁体   中英

How to find user name and password for PostgresSQL on mac?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM