How to provide psql password on Linux server machine

I have a * .sql file using psql. I am working on a Linux server. I use -w

so that it does not ask for a password because at the end my program should be automatic. But I come across this message when I run it:

psql fe_sendauth no password supplied

      

How can I provide a password? As I said, I am working on the server side and have no access to the installation folder.

+3


source to share


1 answer


It doesn't matter if you specify it -w

or not - if the server is configured to prevent anonymous access, it will. You must provide a password or alternatively the server can be configured to trust your IP address or the like.



The task of running PostgreSQL scripts without password prompts is discussed in Postgresql: Executing a psql script with a password .

+1


source







All Articles