Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed PostgreSQL on my Windows 7 machine a few weeks ago. Now I would like to create a database with createdb mydb but I don't remember the password.

Is there anyway to reset the password? I have access to the Administrator account on my machine. Or do I have to uninstall PostgreSQL and then reinstall it again?

How can I reset the password on a PostgreSQL database on my machine?

share|improve this question
up vote 2 down vote accepted

Edit pg_hba.conf to allow access without a password, use "trust". Restart postgresql and you can access PostgreSQL without the usage of a password. Alter your password to something you can remember :) , edit pg_hba.conf again and reload pg_hba.conf.

The Ubuntu-manual has a description about this issue as well.

share|improve this answer
Where in the pg_hba.conf should I put trust? do you have an example? – Jonas Dec 9 '10 at 12:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.