今の作り方


なんかORACLEが不穏な動きに出ており、
MySQLの先が見えづらくなってきたので
PostgreSQLに手を出してみる(;´Д`)

本体

OpenSSLのライブラリが/usr/local/ssl/libであることが前提。

prefixは/usr/local/pgsql
./configure --with-includes=/usr/local/ssl/include \
            --with-libs=/usr/local/ssl/lib \
            --with-pam \
            --with-openssl \
            --with-libxml \
            --with-libxslt \
            --enable-nls=ja

make
make install

専用ユーザの作成。
ホームディレクトリを先のvarディレクトリにする。
groupadd postgres
useradd -g postgres -d /usr/local/pgsql/var -s /bin/bash postgres
passwd postgres

ソケットは規定値で/tmpに作られるが、
インストールディレクトリ以下にruntimeディレクトリを作っておき
そちらにソケットを作るようにする。
mkdir -p /usr/local/pgsql/var/run
chown -R postgres.postgres /usr/local/pgsql/var

初期DB作成

データベースクラスタと称する。

su postgres
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data initdb

トップ   編集 凍結解除 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2012-10-21 (日) 12:16:31