- Go to C:\Program Files\PostgreSQL\9.6\data – replace 9.6 with whatever version your on. This is the default installation path. If you installed your PostgreSQL somewhere else, then change the path accordingly
- Make a backup of pg_hba.conf
- Open and edit pg_hba.conf
- You will see a line like host all all 127.0.0.1/32 md5
- Replace md5 with trust, so it becomes host all all 127.0.0.1/32 trust
- Do the same for the ipv6
- Restart your PostgreSQL service by running services.msc or Task Manager -> Services
- Open CMD
- Run psql -U postgres -h localhost
- Run the command ALTER USER postgres with password ‘NewPassword’;
- Revert changes to pg_hba.conf and restart postgres service again.
- Done
Reset PostgreSQL password in Windows
Published inUncategorized
Be First to Comment