LoginSignup
7
11

More than 5 years have passed since last update.

CentOS7にPostgreSQL9.6をyumで、インストール

Last updated at Posted at 2016-10-07

コマンドラインで、PostgreSQL9.6をインストール

1.
wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm
2.
rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
3.
yum -y install postgresql96-server postgresql96-devel postgresql96-contrib
4. initdbの実行
/usr/pgsql-9.6/bin/postgresql96-setup initdb --no-locale
/usr/pgsql-9.6/bin/postgresql96-setup initdb --locale=C
/usr/pgsql-9.6/bin/postgresql96-setup initdb --encoding=UTF8 --no-locale
/usr/pgsql-9.6/bin/postgresql96-setup initdb --encoding=UTF-8 --locale=ja_JP.UTF-8
オプションをつけると、エラーになる。(記述が間違っている??)

/usr/pgsql-9.6/bin/postgresql96-setup initdb
はOK。
5. パスワードを設定
passwd postgres
6. PostgreSQLの起動
systemctl start postgresql-9.6
systemctl enable postgresql-9.6

systemctl restart postgresql-9.6 

7. confを編集し、接続許可
vi /var/lib/pgsql/9.6/data/pg_hba.conf

pg_hba.confの編集で、下記を試したが、trust以外は、pgadminⅢから、接続できませんでした。
host all all 192.168.24.0/24 trust
以下は、エラー
host all all 192.168.24.0/24 md5
host all all 192.168.24.0/24 password
host all all 192.168.24.0/24 krb5
host all all 192.168.24.0/24 ident
host all all 192.168.24.0/24 cert


詳細な手順と画面は、こちら、http://a23.sblo.jp/article/177152049.html

7
11
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
7
11