Re: DBeaver postgres localhost access

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Pedro Gonçalves <zensalves(at)hotmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: DBeaver postgres localhost access
Date: 2023-05-22 15:44:46
Message-ID: fedb9aaa-c996-79ed-e93d-f7f52574f157@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/20/23 07:09, Pedro Gonçalves wrote:
> Hi.
>
> Good afternoon.
>
> I’m having dificulties with localhost DBeaver postgres training account.
>
> Had access to it and changed password, that presently don’t remember.
>
> What can I do to get access again?
>
> From DBeaver I was told to address this request to PostgreSQL.

1) Find the pg_hba.conf file for the server and change the auth method
to trust for local connections, where local means socket connection.
This is shown in example here:

https://www.postgresql.org/docs/current/auth-pg-hba-conf.html

Example 21.1. Example pg_hba.conf Entries.

2) Reload/restart server

3) Using psql connect with

psql -d <db_name> -U <user_name> -p <port_no>

Once you are connected you can use ALTER USER <user_name> WITH PASSWORD
'some_pwd';

This assumes the <user_name> you connect as has sufficient privileges to
do the the ALTER. One way to ensure that is use the postgres user.

4) Once you have a new password set and shown to work then decide
whether you want local to remain set at trust or change it to something
more secure. If you change it then you will need to repeat 2).

>
> Kind Regards,
>
> Pedro Gonçalves
>

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Xu 2023-05-22 18:02:04 Re: Would PostgreSQL 16 native transparent data encryption support database level encryption?
Previous Message Adrian Klaver 2023-05-22 15:26:54 Re: Database size will be Huge difference while Restoring