I lost the database password. What can I do to recover it?
I lost the database password. What can I do to recover it?
You can’t. However, you can reset it to something else. To do this, you
- edit
pg_hba.confto allow trust authorization temporarily - Reload the config file (pg_ctl reload)
- Connect and issue
ALTER ROLE PASSWORDto set the new password - edit
pg_hba.confagain and restore the previous settings - Reload the config file again