Nasrul Hazim Bin Mohamad

How to reset user’s password in PostgreSQL using Terminal

Jul
07

Assalamualaikum,

A quick solution to reset PostgreSQL user’s password.

Just run following commands after open up the terminal window:

  1. sudo su – postgres
  2. psql -d template1
  3. template1=# ALTER USER postgres WITH PASSWORD ‘some password’g
  4. template1=# q

Then login as usual. 🙂

p/s: I’m using psql 9.1 & ubuntu 12.04 LTS. 🙂

Regards,

Nas

Leave a Reply

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

five − one =