Thread: forgotten data base superuser password

forgotten data base superuser password

From
"Mikhail Utin"
Date:
Hi,
I've been developing my site with postgresql as DB engine since 2000. My DB administrator is gone, and I do not know postgresql (DB superuser) account password. The DB is v.6.5.2 and is running on Linux 5.2 kernel.
I can change the account password to blank using my root account, and set it up while logging in as postgresql. Is that right way to change DB superuser forgotten password? I am not sure how the DB uses pg_shadow file, and if it will be synchronized after I changed the password.
Thank you
 
Mikhail A. Utin

Re: forgotten data base superuser password

From
Tom Lane
Date:
Best way out of that is to temporarily set pg_hba.conf to use
non-password authentication ('trust' or maybe 'ident').  Then
you can connect without the password, update the password field
in pg_shadow, and finally restore pg_hba.conf.

            regards, tom lane