/
Reset lost PostgreSQL admin password
Reset lost PostgreSQL admin password
Problem
The PostgreSQL admin/superuser account password is lost.
Solution
If the PostgreSQL admin/superuser account password is lost follow this procedure to reset it.
- Create a copy of pg_hba.conf so you can revert to it later
- Open pg_hba.conf
- Change "md5" to "trust" everywhere
- Go to the command line (cmd.exe)
- CD into the PostgreSQL bin directory (ex: C:\Program Files\PostgresSQL\9.0\bin)
- Enter: psql -U postgres ForayAdams
- (NOTE: if the admin account isn't postgres user whatever the admin account is named; likewise for the db being ForayAdams)
- Enter: ALTER USER postgres WITH ENCRYPTED PASSWORD 'somestrongpassword';
- (NOTE: again, change postgres if necessary)
- Enter: \q
- Start PgAdmin III and enter the password just set to make sure it works.
- Swap the pg_hba.conf back to the previous version.
Related articles
, multiple selections available,
Related content
Error Creating tables on PostgreSQL
Error Creating tables on PostgreSQL
More like this
Can't delete PostgreSQL database
Can't delete PostgreSQL database
More like this
PostgreSQL Timeout
PostgreSQL Timeout
More like this
Installation of PostgreSQL Error
Installation of PostgreSQL Error
More like this
Search and Replace in the Windows Registry
Search and Replace in the Windows Registry
More like this
Error: The transaction has aborted.
Error: The transaction has aborted.
More like this
© 2023 Foray, LLC - All Rights Reserved