インストール

ダウンロード

解凍・展開

ダウンロードしたファイルが/tmp以下にあるとすると、以下のようにします。

$ tar jxf /tmp/phpPgAdmin-3.1.tar.bz2

当然、HTTPサーバが読んでくれる位置です。今回は、DocumentRoot?で行いました。

設定

できたディレクトリのphpPgAdmin?以下にconfディレクトリがあるのでそこへ移動して、config.ini.phpを編集する。

$ cd phpPgAdmin/conf/
$ emacs config.inc.php

編集するのは、$conf['default_lang'] = 'english';という行を

$conf['default_lang'] = 'japanese';

とするだけで、日本語表示になる。また、PostgreSQLが同一サーバ上以外で動いている場合は、

$conf['servers'][0]['host'] = ''; // Hostname or IP address for server.

の行も適時変更する。

レポート機能

レポート機能とは、SQL文を登録しておくといつでもそのSQL文を呼び出せるという便利な機能です。
機能を使うためにまずは、postgresユーザで、ユーザの作成をする。

$ su - postgres
Password:
$ createuser phppgadmin
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER

次に、用意されたSQL文を以下のように、postgresユーザで流す。このとき存在するDB名を指定しておかないとエラーになる。

$ psql -f phpPgAdmin/sql/reports-pgsql.sql www
CREATE DATABASE
You are now connected to database phppgadmin.
psql:phpPgAdmin/sql/reports-pgsql.sql:20: NOTICE:  CREATE TABLE will create implicit sequence 'ppa_reports_report_id_seq' for SERIAL column 'ppa_reports.report_id'
psql:phpPgAdmin/sql/reports-pgsql.sql:20: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'ppa_reports_pkey' for table 'ppa_reports'
CREATE TABLE
GRANT
GRANT

これで準備が完了。

確認

ブラウザで http://postgresサーバ/phpPgAdmin?/index.phpへアクセスする。

phpPgAdmin01.png

上記のような画面が現れたら、postgresユーザでログインすると以下のような画面が、あらわあれる。

phpPgAdmin02.png

添付ファイル: filephpPgAdmin02.png 482件 [詳細] filephpPgAdmin01.png 496件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2011-01-28 (金) 21:32:53 (4830d)