3

I am attempting a postgresql tutorial and cannot login to the 'postgres' user account which seems to be necessary to perform any actions. When I went through the installation I thought I wrote down the password but apparently not. Is there a way for me to reset the password or do I need to reinstall? Thanks for any advice.

1 Answer 1

14

sudo passwd postgres will let you do it.

Alternatively, sudo su - postgres will let you log in to the postgres user's account without the password at all (you'll be asked for your password to use sudo, naturally).

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks man, worked like a charm. So is the 'postgres' user just a regular system user set to the root user for postgresql? thanks again
The 'postgres' user is indeed a regular system user which runs the postgresql daemon. By default, Postgres uses the system for access control, with the 'postgres' user itself being effectively root for the database server. So, yes, when you log into your computer as 'postgres' (or su), you can then connect directly to the database server with full root-level access.
Thanks again, I am still learning and having it all explained simply like that is a huge help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.