Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2011
    Posts
    14

    Unanswered: How do I disable password checking for accessing database from commandline

    hi ,
    i want to access postgre database by passing command in command line but without password checking ,i m using this command
    "psql.exe -d postgres -p 5432 -U postgres"
    but with this command it prompted to enter password
    is ther any option to pass password with this command ,i tried -w password option with this but extra argument ignored error appears,i want to access postgres database without user interaction
    any help its urgent

  2. #2
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    Three possibilities:

    1) use trust authentication for localhost as described here in the manual: http://www.postgresql.org/docs/curre...tml#AUTH-TRUST

    2) use an environment variable as described here in the manual: http://www.postgresql.org/docs/curre...pq-envars.html

    3) use a password file as described here in the manual: http://www.postgresql.org/docs/curre...pq-pgpass.html

  3. #3
    Join Date
    Apr 2011
    Posts
    14

    how to edit pg_hba.conf file from command line

    Hello shammat,
    Thanks for your reply
    you had written about trust authentication , but how do I set trust authentication without user interaction
    C:\Program Files\Postgresql\8.4\bin>pgadmin3/ch:"C:/program files/postgresql/8.4/data/pg_hba.conf
    I tried this command, but with this a window gets open and ther is option to change methos md5 to trust, is ther any parameters to pass with this command to edit “pg_hba.conf” file silently without user interaction


  4. #4
    Join Date
    Nov 2003
    Posts
    2,934
    Provided Answers: 12
    You have a fundamentally misunderstanding of the pg_hba.conf
    That is a global configuration file for your Postgres installation. You only change that once, after that no passwords are required.

    If you want to do that each time you invoke psql, you should rather use the environment variable or the password file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •