I have tried to Google this question for a long time now, and I do not seem to get to a solution.
I have downloaded PostgreSQL on Windows, and therefore have a user with username: postgres and password: postgres.
I have no problem with connection using the command line: psql -U postgres.
The problem is when I try to just log in through psql or by using an api with npm run start. I tried setting PG_URL=postgres://postgres:postgres@localhost/postgres, since I am using it in this api.
I then get the error message: psql: FATAL: password authentication failed for user "username on my windows computer".
I have not used my username on the computer at all when setting up this database or server, so I do not know what to do. And when I try to log in through psql none of the password I can think of is correct.
This is how the pgAdmin4 page looks like
Faced the exact same problem and the answer provided here solved it solution. Just run set PGUSER=postgres in the command prompt and the next time u run psql the password you enter for username=postgres should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With