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.
How To Resolve Psql: Fatal: Peer Authentication Failed For User “postgres” Error When Login Postgresql In Command Line 1 Postgresql Authentication Methods.#N#Peer Authentication : This authentication method will use the base operating... 2 How To Change Postgresql Authentication Method. More ...
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket “/tmp/.s.PGSQL.5432”? Incorrect authentication method ( ident) configured on PostgreSQL. Connect to the server via SSH.
Peer Authentication : This authentication method will use the base operating system’s user name and password as the postgresql database server user account to login, this method is only effetive for local postgresql connection.
Incorrect authentication method ( ident) configured on PostgreSQL. Connect to the server via SSH. Edit file /var/lib/pgsql/data/pg_hba.conf, replacing ident to trust in the section beginning with “local”, as follows:
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
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