4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

yumからPostgreSQLの最新版をインストールする

Last updated at Posted at 2017-06-29

PostgreSQLの最新版をyumでインストールするための手順です。
詳しくは以下のサイトを参照してください。
https://yum.postgresql.org/howtoyum.php
https://yum.postgresql.org/

RPMパッケージの最新版を確認する

RPMのダウンロードとyumインストール

【例】CentOS7 x86_64、PostgreSQL9.6(2017年6月現在の安定版)

$ wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
$ sudo rpm -ivh pgdg-centos96-9.6-3.noarch.rpm
$ sudo yum -y install postgresql96-server postgresql96-devel postgresql96-contrib

DB初期化、自動起動設定、接続設定の編集

$ sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
$ sudo systemctl start postgresql-9.6
$ sudo systemctl enable postgresql-9.6
$ sudo systemctl status postgresql-9.6
$ sudo vi /var/lib/pgsql/9.6/data/pg_hba.conf

DBユーザの作成

$ su - postgres
$ psql
# CREATE USER hoge WITH PASSWORD 'hogehoge';
# \q
$ psql hoge

PostgreSQLディレクトリ構成

  • コマンド、ライブラリなど
    /usr/pgsql-9.6

  • データ関係
    /var/lib/pgsql/9.6

4
3
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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?