Quantcast
Channel: ソフラボの技術ブログ
Viewing all articles
Browse latest Browse all 166

CentOS6.2にPostgreSQL9.2をインストールする

$
0
0

yumの通常のリポジトリからはバージョン8がインストール出来ないので、
公式サイトからrpmをダウンロードしそこからインストールします。

PostgreSQLの最新版は「9.2」です。9.3はベータ版なのでご注意を。

手順

1.PostgreSQL RPM Repository (with Yum)よりrpmをダウンロードする

# 32bit
wget /tmp http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm# 64bit
wget /tmp http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm


2.rootでrpmをインストールする

rpm-ivh /tmp/pgdg-centos92-9.2-6.noarch.rpm

3.yumでpostgresqlをインストールする

yum install postgresql92-server postgresql92-devel postgresql92-contrib


4.DBを初期化する

/etc/rc.d/init.d/postgresql-9.2 initdb


起動・停止等

# 起動
service posgtresql-9.2start# 停止
service posgtresql-9.2stop# 再起動
service posgtresql-9.2restart# 状態確認
service posgtresql-9.2status# 設定再読み込み
service posgtresql-9.2reload# 設定再読み込み(強制)
service posgtresql-9.2 force-reload# 自動起動
chkconfig postgresql-9.2 on
# 自動起動確認
chkconfig --list | grep postgresql-9.2


以上です。結構簡単にインストールできました。

PostgreSQLおすすめの書籍

PostgreSQL全機能バイブルPostgreSQL全機能バイブル
鈴木 啓修

技術評論社 2012-11-16
売り上げランキング : 81581

Amazonで詳しく見る
by G-Tools

Viewing all articles
Browse latest Browse all 166

Trending Articles