Re: DBeaver postgres localhost access - Mailing list pgsql-general

From Adrian Klaver
Subject Re: DBeaver postgres localhost access
Date
Msg-id fedb9aaa-c996-79ed-e93d-f7f52574f157@aklaver.com
Whole thread Raw
In response to DBeaver postgres localhost access  (Pedro Gonçalves <zensalves@hotmail.com>)
List 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.klaver@aklaver.com




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Database size will be Huge difference while Restoring
Next
From: Tony Xu
Date:
Subject: Re: Would PostgreSQL 16 native transparent data encryption support database level encryption?