LoginSignup
3
4

More than 5 years have passed since last update.

PostgreSQL のログイン時にパスワードを省略する方法

Posted at

PostgreSQLのデータベースにログインするときにいちいちパスワードを入力するのが面倒なのでやってみたメモ

環境

OS・ミドルウェア バージョン
OS CentOS release 6.7 (Final)
PostgreSQL 9.2.24

手順

## .pgpassファイルを作成
# vi .pgpass

## 次の内容を記載
<DBサーバのホスト名>:<DBサーバのポート>:<データベース名>:<ユーザ名>:<パスワード>

# 記載したら保存する

## 権限を以下のコマンドで変更する
# chmod 600 .pgpass
3
4
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
3
4