HOMEへ戻る コンピュータ関係 健康関係 生活関係 その他

PostgreSQL7.3.2 の設定
  • PostgreSQLのダウンロード
    PostgreSQLのダウンロードサイトは,ftp://ftp.postgresql.org/pub/source/です。
    ここでは"v7.3.2"フォルダ内にあるpostgresql-7.3.2.tar.gzというファイルをダウンロードします。
    ダウンロードしたファイルは/tmpにでも保存してください。

  • ユーザ名「postgres」の作成
    $ /usr/sbin/adduser postgres
    $ passwd postgres
    パスワードを入力

  • PostgreSQL 用のディレクトリを作成
    $ su -
    $ mkdir /usr/local/pgsql
    $ chown postgres.postgres /usr/local/pgsql

  • PostgreSQL のコンパイルとインストール
    $ tar zvxf postgresql-7.3.2.tar.gz
    $ cd postgresql-7.3.2
    $ ./configure --enable-multibyte=EUC_JP
    $ make all
    $ make install

  • 環境変数の設定
    $ vi /etc/profile

    [/etc/profile]ファイルに追加する内容
    PATH="$PATH":/usr/local/pgsql/bin
    export POSTGRES_HOME=/usr/local/pgsql
    export PGLIB=$POSTGRES_HOME/lib
    export PGDATA=$POSTGRES_HOME/data

  • データベースの初期化
    $ su postgres
    $ initdb


    「Success. You can now start the database server・・・」

  • PostgreSQLサーバの起動
    $ su postgres
    $ pg_ctl start

  • Linux起動時に自動起動させる
    $ vi /etc/rc.d/rc.local

    [rc.local]ファイルの最後に書き込む内容
    su -c '/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data' postgres > /dev/null


参考文献:PHP入門 - 関数からデータベース連携まで (エーアイ出版)

HOME -  Computer -  Health -  Life -  etc -  お問合せ
©2005-2006 Person Of All Trades. All Rights Reserved