0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows環境のpsqlにパスワード入力無しで入る

Posted at

DBに対しpsqlコマンドなどで処理を投げたい時がある。
このとき処理を書いたシェルスクリプト等を実行するとパスワード入力を求められて自動化に失敗する。
これが鬱陶しいのでパスワード入力を省略する。
たまにやろうとすると忘れているのでメモ

環境

  • Windows11
  • PostgreSQL15

パスワードファイル作成

psql接続設定を記述したファイルを作成する。

pgpass.conf
hostname:port:database:username:password

上記ファイルをC:\Users\username\AppData\Roaming\postgresql\に配置する。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?