Re: how to recover superuser password ?

From: Joel Burton <joel(at)joelburton(dot)com>
To: Patrick <pat(at)patoche(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to recover superuser password ?
Date: 2002-12-02 16:42:25
Message-ID: 20021202164225.GA11465@temp.joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Dec 02, 2002 at 05:34:04PM +0100, Patrick wrote:
> My superuser (postgres) had a password.
> I attempted to change it by doing (and not thinking very much):
> template1=# alter user postgres with password '';
> ALTER USER
> template1=# \q
>
> After what I am unable to connect anymore as superuser, which is a
> big problem (plain [ENTER] on the password prompt is rejected)
>
> Is there any way to change the superuser password without completely
> deleting my postgreSQL installation which is in use in production ?
> (I have complete unix root access)
>
> Thanks to all in advance.
> I did not found anything relevant online.

Change your pg_hba.conf to allow connections from the localhost as
"trust" (then kill -HUP the postmaster to notice the changes here).
Log in from localhost (you won't be prompted for a
password). Now you can change your password.

Be sure to change pg_hba.conf back to what it was!

--

Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Patrick 2002-12-02 16:53:39 Re: how to recover superuser password ?
Previous Message Patrick 2002-12-02 16:34:04 how to recover superuser password ?