HostOnNet Blog

PostgreSQL Change User Password

Looking for Linux Server Admin or WordPress Expert? We can help.

postgreSQL

Create A User

To create user in PostgreSQL, run

sudo -u postgres -i
createuser -s <username>
exit

Change User Password

sudo -u postgres -i
psql
ALTER USER USER-NAME-HERE WITH PASSWORD 'PASSWORD-HERE';
\q
exit

OR

root@maps:~# sudo -u postgres -i
postgres@maps:~$ psql
psql (9.3.10)
Type "help" for help.

postgres-# \password USER-NAME-HERE
Enter new password: 
Enter it again: 
postgres-#

Posted in Linux

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.