Thread:

From
Нурдаулет Лесбек
Date:
Hi!
I'm forget the administrator's (root) password from PostgreSQL server. How can I restore it?
Please, help me!

Kind regards 

Re:

From
Christophe Pettus
Date:

> On Oct 28, 2022, at 03:00, Нурдаулет Лесбек <lokiodinson72@gmail.com> wrote:
> I'm forget the administrator's (root) password from PostgreSQL server. How can I restore it?

You can start up PostgreSQL in single-user mode, which will allow you to change it to a known value;

    https://www.postgresql.org/docs/current/app-postgres.html


Re:

From
Adrian Klaver
Date:
On 10/28/22 03:00, Нурдаулет Лесбек wrote:
> Hi!
> I'm forget the administrator's (root) password from PostgreSQL server. 
> How can I restore it?
> Please, help me!

1) The appropriate list for this sort of question is pgsql-general:

https://www.postgresql.org/list/pgsql-general/

2) In addition to Christophe's suggestion:

Check your pg_hba.conf file for a uncommented line like:

local   all             postgres                                trust

If it is there then you can on the server machine do:

psql -d database -U postgres

to make a local connection via socket without a password.

If it is not there then add it and reload the server settings.

> 
> Kind regards

-- 
Adrian Klaver
adrian.klaver@aklaver.com