Reaching out to others! Free & Open Source Software, Kannada, L10n, L18n Data Science, Cloud Computing & more…

Reset postgres user password in PostgreSQL server

Gnu/Linux, QuickFix, Technical | 0 comments

To reset the password of postgres user follow the instructions given below.

First change the password of system user postgres:

# passwd postgres
Changing password for user postgres.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

Now, its time to change the password of postgres user in database.

Login as postgres user at console

#su postgres

Now enter the psql prompt

#psql
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

Here alter the password for the role postgres using following sql statement:

alter user postgres with password ‘new_password’;

Now, you should be able to login to postgres with the above given password

Related Articles

Related