Psql does not prompt password requset [Solved]
First excuse me for my poor English.
My problem is that when I run command
mojtaba@MOJTABA-PC:~$ psql -U postgres
in terminal it does not request for password and log in with all privilege and print:
Type "help" for help.
while pg_hba.conf file is:
local all postgres md5
local all all md5
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
what is the problem?
thanks in advance
It sounds like you have not yet set a password for the postgres user.
Once you're at the postgres=# prompt, enter this:
ALTER USER Postgres WITH PASSWORD '<newpassword>';
Replace the <newpassword> with whatever you want your password to be.
After that, the postgres user should requite authentication.
thanks for your reply
but I d have set password for postgres and when I use -W option it request password for user postgres. I have confused. Please help me
Check if you have an environment PGPASS defined.
Details on that are here: http://www.postgresql.org/docs/current/static/libpq-envars.html
Check if you have a pgpass file
Details on that are here: http://www.postgresql.org/docs/current/static/libpq-pgpass.html
Thank you very much
I remove password from .pgpass file and problem fixed.
unfortunately my english is week to properly acknowledge you.