How to reset user’s password in PostgreSQL using Terminal

By | July 7, 2012


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. πŸ™‚



Leave a Reply

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

eighteen − one =