How do I change the password for PostgreSQL user?

2
22

To log in without a password:

sudo -u user_name psql db_name

To reset the password if you have forgotten:

ALTER USER user_name WITH PASSWORD 'new_password';

Leave a Reply

Your email address will not be published. Required fields are marked *