I am new to PostgreSQL and before I start learning got stuck in the password; I have forgotten my password to PostgresSQL 13 path when I use pdAdmin tool.
I use mac. Apologies for basic questions.
I went through multiple articles, videos but I am unable to through different steps.
Steps I did:
- Downloaded PostgreSQL 13, logged into pgAdmin, forgot password to PostgreSQL 13 db
- Found the "pg_hba.conf" and edited the method from "md5" to "trust"
Steps I am unable to proceed and stuck:
- Restart the postgresql service (where and how do I do this? via launching Terminal?)
- Start psql session as postgres (how to launch? I searched the psql via search. When I entered "psql -U postgres", its asking for "Database" and "Port (5432)" and "Username". I am unaware to find these"
This is where I am unable to go to next step to use ALTER USER command to reset.
I went through this but when I enter the command "sudo -u user_name psql db_name", its asking for all information above which I don't have knowledge yet. Same as above points where I am getting stuck.
Many thanks in advance.