psql: error: could not connect to server: FATAL: password authentication failed for user
Asked Answered
T

1

7

I have successfully installed postgresql and added path to my environment variable in windows 10. But the problem is when i try to run psql postgresql in command prompt it gives error saying

C:\Users\adity>psql postgres
Password for user adity:
psql: error: could not connect to server: FATAL:  password authentication failed for user "adity"

I am 100% sure my password is correct I have tried reinstalling and uninstalling many time in case i missed password but every time it gives me same error. Although when i try to run from GUI it starts running. This is frustrating and I am not sure what the problem is.

Thereby answered 6/12, 2019 at 9:11 Comment(0)
I
11

The database superuser that was created during database cluster creation is very likely called postgres.

So rather than using the default, which is to use the database user whose name is the same as your current operating system user, explicitly specify the database user postgres:

psql -U postgres
Ilsa answered 6/12, 2019 at 9:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.