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?

link|improve this question

feedback

1 Answer

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.

link|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
1  
feedback

Your Answer

 
or
required, but never shown

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