#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    4
    Rep Power
    0

    Psql does not prompt password requset [Solved]


    Hi everybody
    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:
    psql (9.1.3)
    Type "help" for help.

    postgres=#

    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
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    4
    Rep Power
    0
    Please help me.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    14
    Rep Power
    0
    Hi,

    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.

    Joe
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    4
    Rep Power
    0
    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
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,784
    Rep Power
    348
    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
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Posts
    4
    Rep Power
    0
    Thank you very much
    I remove password from .pgpass file and problem fixed.

    unfortunately my english is week to properly acknowledge you.
    thanks

IMN logo majestic logo threadwatch logo seochat tools logo