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?


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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