Re: How to behive if I remove password from postgres role

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Raivo Rebane <raivore55(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to behive if I remove password from postgres role
Date: 2023-03-15 16:12:11
Message-ID: aa604dc4-16d1-ce5c-ce35-f0c15fa1b6ed@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 3/15/23 09:02, Raivo Rebane wrote:
> HI
>
> I wanted to install PostGIS Bundle so that it builds a sample spatial
> database, but got error - createdb: error: connection to server at
> "localhost" (::1), port 5432 failed: FATAL:  password authentication
> failed for user "postgres"
> Then I altered role of postgres so, that password = NULL.
> Now I am in situation that I can't run any postgres command.
> What I must to do ?

Edit the
pg_hba.conf(https://www.postgresql.org/docs/15/auth-pg-hba-conf.html) so
that the first local line is set to trust as in the 'Example 21.1.
Example pg_hba.conf Entries' at the bottom of the file. It may already
be set that way.

In either case when you connect do not use a host setting e.g. do not do
host=localhost. This will ensure you are connecting to the local socket
instead and will be using the trust authentication method and not a
password. Once you are in you can alter the postgres user to have a
proper password.

>
> Regards,
> Raivo
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-03-15 16:12:23 Re: How to behive if I remove password from postgres role
Previous Message Arthur Ramsey 2023-03-15 16:10:59 Re: Table scan on 15.2