How to Change the PostgreSQL Administrator Password
There may be a time when you forget your PostgreSQL administrator password. The process below describes how you can log in without a password to change the password of PostgreSQL.
How to Log In to PostgreSQL Without a Password
- Search for
pg_hba.confwhich should be located in
Right click and edit
pg_hba.confusing a text editor
- Scroll down the text file and you will see something as described in the screenshot below :
- Change the "md5" method to "trust" and save the file as described in the screenshot below:
- Login to PostgreSQL using pgAdmin, without a password
- From there on you should be able to go to the UI and change the password
pg_hba.confusing a text editor and change "trust" back to "md5"
- Password is now changed!