Linux

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 


Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts