resetting superuser password

Started by madover 20 years ago3 messagesgeneral
Jump to latest
#1mad
mad7@runbox.com

I have lost the superuser (user postgres) password, but I still have
the unix root password. Is there anything I can do to reset the
postgres user's password (short of reinstalling Postgres)?

Obviously, I can su to unix user postgres, but this does not seem to
advance my cause, as doing "psql -U postgres" still prompts me for a
password, which is not the same as the unix postgres user's password.

OS: RedHat 9

Help!

Thanks,
Marc

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: mad (#1)
Re: resetting superuser password

On Wed, Nov 09, 2005 at 04:42:39AM -0800, mad wrote:

I have lost the superuser (user postgres) password, but I still have
the unix root password. Is there anything I can do to reset the
postgres user's password (short of reinstalling Postgres)?

Edit pg_hba.conf to let you in without a password, then you can login
and change it.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.

#3TJ O'Donnell
tjo@acm.org
In reply to: Martijn van Oosterhout (#2)
Re: resetting superuser password

I would unix su, edit pg_hba.conf to allow open access
temporarily, connect to pg and change the posgres password.
Don't forget to change pg_hba.conf back again to password
protect the db!

TJ

Show quoted text

I have lost the superuser (user postgres) password, but I still have
the unix root password. Is there anything I can do to reset the
postgres user's password (short of reinstalling Postgres)?