1

recently i have installed postgresql 9.4 on my windows 8 machine while installing PostgreSQL though GUI interface it prompt me for password i entered password and then installed process completed afterward. when i go cmd prompt (through administrative right)and type "psql" it prompts me for password ,when i enter the same password i used while installing PostgreSQL i get following error.

C:\Users\saphal>psql
Password:
psql: FATAL:  password authentication failed for user "saphal"

please suggest me.

2 Answers 2

1

Try:

psql postgres <user_name>

Where postgres is the name of the main database and <user_name> is the user that owns the postgres installation. Usually this will be postgres or psql too, but it they don't work, try your own user name. (I'm not sure this is set up on a Windows system.)

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

3 Comments

Default user is postgres on windows, like in Linux.
Still i am getting this error message C:\Users\saphal>psql postgres saphal Password for user saphal: psql: FATAL: password authentication failed for user "saphal"
What happens if you try psql postgres postgres?
1

Most likely the installation created a default role called "postgres". Try running the psql command with the username option:

psql -U postgres

Then when asked for the password use the one you specified during the installation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.