Set Default Password For Postgres User For Psql

Posted by Weston Ganger on October 21, 2015

Im always forgetting how to do this. Dont set the password for the linux account postgres, instead set the password for the postgres user in psql.

sudo -u postgres psql postgres

# In psql prompt
\password postgres
# Enter your password

Now when you want to connect to psql use the following command

psql postgres -U postgres

See my other article on setting it up with the current user so your not messing around with the postgres user

Related External Links:

Posted in Linux and Tagged with database postgresql psql linux 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts