public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Password forgotten
2+ messages / 2 participants
[nested] [flat]

* Re: Password forgotten
@ 2024-04-23 13:27 David G. Johnston <[email protected]>
  2024-04-23 14:19 ` Re: Password forgotten Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: David G. Johnston @ 2024-04-23 13:27 UTC (permalink / raw)
  To: Arbol One <[email protected]>; +Cc: [email protected] <[email protected]>

On Tuesday, April 23, 2024, Arbol One <[email protected]> wrote:

> Hello.
> In my Debian box, after entering this command to psql-16, *psql -h
> localhost -U postgres*
>
> psql-16 asks for the password, which I have forgotten.
> So I get this message:
>
>
>
> *psql: error: connection to server at "localhost" (::1), port 5432 failed:
> FATAL:  password authentication failed for user "postgres" connection to
> server at "localhost" (::1), port 5432 failed: FATAL:  password
> authentication failed for user "postgres" *
>
> Is there a way I can retrieve this master password?
>

Nope.  You need to login using a method that doesn’t require a password
then change the password.  See pg_hba.conf for authentication options.
Usually connecting via local and peer authentication is the default option.

David J.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Password forgotten
  2024-04-23 13:27 Re: Password forgotten David G. Johnston <[email protected]>
@ 2024-04-23 14:19 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-04-23 14:19 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: Arbol One <[email protected]>; [email protected] <[email protected]>

"David G. Johnston" <[email protected]> writes:
> On Tuesday, April 23, 2024, Arbol One <[email protected]> wrote:
>> psql-16 asks for the password, which I have forgotten.
>> Is there a way I can retrieve this master password?

> Nope.  You need to login using a method that doesn’t require a password
> then change the password.  See pg_hba.conf for authentication options.
> Usually connecting via local and peer authentication is the default option.

If all else fails, shut the server down and start it in single-user
mode.  That will let you in as a superuser and you can use ALTER USER
to reset the role's password.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-04-23 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 13:27 Re: Password forgotten David G. Johnston <[email protected]>
2024-04-23 14:19 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox