Обсуждение: How to set password in psql -h -d -U command line?

Поиск
Список
Период
Сортировка

How to set password in psql -h -d -U command line?

От
Shaozhong SHI
Дата:
I tried various ways to set password in psql command line, but got no luck.

Can anyone help?

Regards,

David

Aw: How to set password in psql -h -d -U command line?

От
Karsten Hilbert
Дата:
> I tried various ways to set password in psql command line, but got no luck.

Have you tried all the methods that you showed in your mail or did you try others as well ?

Best regards,
Karsten




Re: How to set password in psql -h -d -U command line?

От
Joao Miguel Ferreira
Дата:
Hello,

I usually use this approach:

PGPASSWORD=secret psql -h 127.0.0.1 -p 5432 -U joao mydatabase

it has the down side that the password is shown in the command. need to be careful about that aspect


On Thu, Apr 28, 2022 at 10:33 AM Shaozhong SHI <shishaozhong@gmail.com> wrote:
I tried various ways to set password in psql command line, but got no luck.

Can anyone help?

Regards,

David

Re: How to set password in psql -h -d -U command line?

От
Josha Inglis
Дата:
Either set the PGPASSWORD environment variable or set up a .pgpass file

Josha

On Thu, 28 Apr 2022 at 19:33, Shaozhong SHI <shishaozhong@gmail.com> wrote:
I tried various ways to set password in psql command line, but got no luck.

Can anyone help?

Regards,

David
--
Kind Regards

Josha Inglis

Re: How to set password in psql -h -d -U command line?

От
alias
Дата:

On Thu, Apr 28, 2022 at 3:13 PM Josha Inglis <joshainglis@gmail.com> wrote:
Either set the PGPASSWORD environment variable or set up a .pgpass file

Josha

On Thu, 28 Apr 2022 at 19:33, Shaozhong SHI <shishaozhong@gmail.com> wrote:
I tried various ways to set password in psql command line, but got no luck.

Can anyone help?

Regards,

David
--
Kind Regards

Josha Inglis