9
8

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.

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

Last updated at Posted at 2016-10-18

環境

Vagrantを使用

  • CentOS 6.6 64bit

インストール方法

標準のリポジトリで PostgreSQL がインストールされないように設定
sudo vi /etc/yum.repos.d/CentOS-Base.repo
[base]
.
.
exclude=postgresql* # 末尾に追加
[updates]
.
.
exclude=postgresql* # 末尾に追加
yum リポジトリを追加

以下は64bit版です。

sudo yum -y localinstall https://yum.postgresql.org/9.6/redhat/rhel-6.7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
PostgreSQLインストールと初期設定
sudo yum -y install postgresql96-server
sudo service postgresql-9.6 initdb
sudo service postgresql-9.6 start
sudo chkconfig postgresql-9.6 on
postgresユーザーのパスワード変更
sudo passwd postgres
接続してみる
su - postgres
psql

\qで切断できます

設定ファイルを変更

/lib/pgsql/9.6/data/配下にpg_hba.conf等があるので編集する

9
8
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
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?