LoginSignup
0
1

More than 5 years have passed since last update.

ubuntu desktop に postgresql をインストールする

Posted at

この記事は、ubuntu desktop に postgresql をインストールして、Windowsマシンからアクセスできるようにする手順について記載したものです。

(1) postgresql をインストールします。
$ sudo apt-get install postgresql

(2) pg_hba.conf ファイルを検索して、編集します。
$ sudo find / -name pg_hba.conf
$ sudo vi /etc/postgresql/10/main/postgresql.conf

(3) 以下の内容を追記します。

# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 192.168.179.0/24 trust <-- これを追加(※1)

(※1) クライアント側からアクセスされるIPアドレスに対して設定しています。
   こちらの環境では、192.168.179.X からのアクセスを許可する設定にしています。

(4) postgresql のサービスを再起動します。
$ sudo service postgresql stop
$ sudo service postgresql start

(5) Windowsマシン から postgresql にアクセスする。
pgAdmin をインストールして、以下の手順で ubuntu desktop側 の postgres を追加します。
1.ファイル -> サーバの追加 をクリックします。
image.png

2.ubuntu desktop側の情報を入力します。
image.png

3.これで ubuntu desktop 側の postgres が表示されました。
image.png

0
1
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
1