1

I can't connect on postgresql.

when i go on pgadmin>server>postgresql, it asked me "please enter the password for the user 'postgres' to connect the server?

I have windows 10 and postgresql 14.

But I don't have this password. What can I do?

enter image description here

3

1 Answer 1

3

The following worked for me.
Change METHOD of all rows in your pg_hba.conf file from scram-sha-256 to trust (C:\Program Files\PostgreSQL\14\data\pg_hba.conf). This will disable password for your DB.
Click on any database in postgresql to use Query Tool.

In Query Tool type ALTER USER postgres WITH PASSWORD 'User_password'; postgres is default username, execute it.
This way you can set up a password for your DB, after that go back to the first step and change it back from trust to scram-sha-256.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.