0

sql file that I backedup a long time ago of my website database and now I'm trying to use it but everytime I use:

psql -U <username> -d --password <dbname> -1 -f <filename>.sql

it gives me this error

peer authentication failed for user "USER"

I tried to edit the pg_hba.conf but that did nothing.

how can I do it ?

1 Answer 1

1

Several mistakes:

  1. You didn't edit pg_hba.conf properly or you forgot to reload PostgreSQL.

    Add your pg_hba.conf to the question for more details.

  2. Your command line is syntactically incorrect; --password will be interpreted as argument of -d. Try

    psql -U <username> -d <dbname> --password -1 -f <filename>.sql
    
Sign up to request clarification or add additional context in comments.

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.