PostgreSQL/インストール
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
[[:PostgreSQL]]
*PostgreSQLのインストール
#contents
**ダウンロード
http://www.sra.co.jp/people/t-ishii/PostgreSQL/より、最新...
今回は、postgresql-7.3.2.tar.gzをダウンロードしました。
**準備
ダウンロードしている間に、以下のことをすませてしまいます。
***グループ・ユーザの追加
専用のグループ・ユーザを用意します。
# /usr/sbin/groupadd postgres
# /usr/sbin/useradd -g postgres postgres
***インストール先の準備
postgresユーザでインストールしますので、インストール先の...
# mkdir /usr/local/pgsql
# chown postgres:postgres /usr/local/pgsql
# ls -l /usr/local
drwxr-xr-x 2 postgres postgres 4096 5月 13 13:50...
これで、準備は完了です。
**展開
postgresユーザでインストールするため、通常のソースインス...
# su - postgres
$ tar zxf postgresql-7.3.2.tar.gz
いつも通りです。''v''オプションをつけないと、展開の様子が...
**configure
$ cd postgresql-7.3.2
$ ./configure
7.2までは、色々とオプションをつけてましたが、必要ありませ...
''--enable-multibyte''で指定していたものは、initdb時に指...
''--enable-locale''は標準装備になりましたので、日本語に不...
''--enable-syslog''は、標準装備になりました。
**make
$ make all
$ make check
ここまでやり、最後に、
======================
All 89 tests passed.
======================
と表示されれば問題ないので、インストールします。
**インストール
$ make install
**初期設定
PosgreSQLを使用するために、設定を行います。
***環境変数
postgresユーザの.bashrcに以下の内容を追加します。
PG=/usr/local/pgsql
export PATH="$PATH":$PG/bin
export MANPATH="$MANPATH":$PG/man
export PGLIB=$PG/lib
export PGDATA=$PG/data
''PGDATA''に関しては、データファイルの保存位置になります...
設定は、次回ログイン時から読み込まれますので、今回は、以...
$ source .bashrc
***データベースクラスタの作成
PostgreSQL ではデータベースクラスタといわれるディレクトリ...
$ initdb --encoding=EUC-JP --no-locale
''--encoding=EUC_JP''データベースのデフォルトの文字エンコ...
''--no-locale''ロケールを利用しません。
***起動
PostgreSQLのデーモンであるpostmasterを以下のように起動し...
$ pg_ctl -w start
postmasterが起動されたらデータベースへ接続できるかを以下...
$ psql -l
List of databases
Name | Owner | Encoding
-----------+----------+----------
template0 | postgres | EUC_JP
template1 | postgres | EUC_JP
(2 rows)
**自動起動
ソースを展開したディレクトリ以下の、''/contrib/start-scri...
# cd (ソース展開ディレクトリ)/contrib/start-scripts
# cp linux /etc/rc.d/init.d/postgres
コピー先へ移動し、スクリプトを登録します。
# cd /etc/rc.d/init.d/
# chmod 755 postgres
# /sbin/chkconfig --add postgres
以下のように確認ができれば、完了です。
# /sbin/chkconfig --list | grep postgres
postgres 0:オフ 1:オフ 2:オン 3:オン 4:オン ...
終了行:
[[:PostgreSQL]]
*PostgreSQLのインストール
#contents
**ダウンロード
http://www.sra.co.jp/people/t-ishii/PostgreSQL/より、最新...
今回は、postgresql-7.3.2.tar.gzをダウンロードしました。
**準備
ダウンロードしている間に、以下のことをすませてしまいます。
***グループ・ユーザの追加
専用のグループ・ユーザを用意します。
# /usr/sbin/groupadd postgres
# /usr/sbin/useradd -g postgres postgres
***インストール先の準備
postgresユーザでインストールしますので、インストール先の...
# mkdir /usr/local/pgsql
# chown postgres:postgres /usr/local/pgsql
# ls -l /usr/local
drwxr-xr-x 2 postgres postgres 4096 5月 13 13:50...
これで、準備は完了です。
**展開
postgresユーザでインストールするため、通常のソースインス...
# su - postgres
$ tar zxf postgresql-7.3.2.tar.gz
いつも通りです。''v''オプションをつけないと、展開の様子が...
**configure
$ cd postgresql-7.3.2
$ ./configure
7.2までは、色々とオプションをつけてましたが、必要ありませ...
''--enable-multibyte''で指定していたものは、initdb時に指...
''--enable-locale''は標準装備になりましたので、日本語に不...
''--enable-syslog''は、標準装備になりました。
**make
$ make all
$ make check
ここまでやり、最後に、
======================
All 89 tests passed.
======================
と表示されれば問題ないので、インストールします。
**インストール
$ make install
**初期設定
PosgreSQLを使用するために、設定を行います。
***環境変数
postgresユーザの.bashrcに以下の内容を追加します。
PG=/usr/local/pgsql
export PATH="$PATH":$PG/bin
export MANPATH="$MANPATH":$PG/man
export PGLIB=$PG/lib
export PGDATA=$PG/data
''PGDATA''に関しては、データファイルの保存位置になります...
設定は、次回ログイン時から読み込まれますので、今回は、以...
$ source .bashrc
***データベースクラスタの作成
PostgreSQL ではデータベースクラスタといわれるディレクトリ...
$ initdb --encoding=EUC-JP --no-locale
''--encoding=EUC_JP''データベースのデフォルトの文字エンコ...
''--no-locale''ロケールを利用しません。
***起動
PostgreSQLのデーモンであるpostmasterを以下のように起動し...
$ pg_ctl -w start
postmasterが起動されたらデータベースへ接続できるかを以下...
$ psql -l
List of databases
Name | Owner | Encoding
-----------+----------+----------
template0 | postgres | EUC_JP
template1 | postgres | EUC_JP
(2 rows)
**自動起動
ソースを展開したディレクトリ以下の、''/contrib/start-scri...
# cd (ソース展開ディレクトリ)/contrib/start-scripts
# cp linux /etc/rc.d/init.d/postgres
コピー先へ移動し、スクリプトを登録します。
# cd /etc/rc.d/init.d/
# chmod 755 postgres
# /sbin/chkconfig --add postgres
以下のように確認ができれば、完了です。
# /sbin/chkconfig --list | grep postgres
postgres 0:オフ 1:オフ 2:オン 3:オン 4:オン ...
ページ名: