Re: Forgotten Password - Mailing list pgadmin-support

From Muhammad Ikram
Subject Re: Forgotten Password
Date
Msg-id CAGeimVqLa9JbUkDGZW99ESG3BpavZWi_UXQZecU1UVHuofwVAA@mail.gmail.com
Whole thread Raw
In response to Re: Forgotten Password  (Khushboo Vashi <khushboo.vashi@enterprisedb.com>)
List pgadmin-support

Hi Benjamin,

If you are still not able to locate pg_hba.conf then please try to find it using find command. Here is a sample on my mac machine.

find /Library/PostgreSQL -name pg_hba.conf
/Library/PostgreSQL/14/data/pg_hba.conf

Ensure that you have permissions to edit this file.

Once you are able to open and edit this file then you may replace (scram-sha-256 with trust) for the user. You will be able to login without a password. Set new password and then revert back the changes in pg_hba.conf file to keep PostgreSQL secure.

Sample from pg_hba.conf given below

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     scram-sha-256
# IPv4 local connections:
host    all             all             127.0.0.1/32            scram-sha-256


Regards,
Muhammad Ikram



On Mon, Aug 5, 2024 at 9:36 AM Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

On Fri, Aug 2, 2024 at 4:50 PM Benjamin Lund <blund@student.unimelb.edu.au> wrote:
Hi there, 

 I have recently created an account on pgAdmin 4 as part of a university course. After making a server with this account and password, I then went to reopen this server a few days later only to realise I needed my password which I have sadly forgotten. 
If you forgot the pgAdmin password, then the Forgot Password link is there on the login page.
If you forgot your PostgreSQL password, then as mentioned by you, find the pg_hba file and do appropriate changes to login without password, you will find many blogs/videos for that. 

I have looked online for help, but I am unable to find the mentioned 'pg_hba' file that I need. For reference I am working on Mac. 

Is there any other way I can reset this password and gain access to the server? I have also tried uninstalling the application but this has not solved the issue and when reinstalled it is still attached to my account/password. 
How have you installed Postgres? 

Thanks, 

Ben


--
Muhammad Ikram

pgadmin-support by date:

Previous
From: Khushboo Vashi
Date:
Subject: Re: Forgotten Password
Next
From: Anthony Cox
Date:
Subject: GUI pgAdmin for Mac