http://www.atmarkit.co.jp/flinux/rensai/postgres02/postgres02.html
> su - postgres > initdb
> postmaster -S -i
> createdb test
> psql test
test=# create table test (shainno int,shimei text);
test=# \d List of relations Name | Type | Owner ------+-------+---------- test | table | postgres (1 row) test=#
pg_ctl restart
mt/mt.cfg は
ObjectDriver DBI::postgres Database test DBUser postgres
としてみた。ObjectDriver? の指定は、
mt/lib/MT/ObjectDriver/DBI/
内の postgres.pm を参照してるみたいですね。
ブラウザでmt-load.cgiにアクセスしてみたら
Connection error: FATAL 1: IDENT authentication failed for user "postgres"
となった。どうもUNIXのログインに失敗してるのかっつうことで、
passwd postgres <- rootで実行
してみた。んで /mt/mt-db-pass.cgi にはそのパスワードを書いておいた。
そもそも認証なしの設定がデフォルトみたい。それを変更する。
/data/pg_hba.conf で
#local all ident sameuser <- コメントアウト local all password sameuser <- 新規に追加
としてみた。リスタートしたら、パスワードを聞いてくるようになった。 でも、なぜかエラーになってしまう。 http://ml.postgresql.jp/pipermail/pgsql-jp/2002-December/003512.html を見てみると、 7.3 から ALTER USER でのパスワードが MD5 で格納されるようです。とのこと。
local all md5 host all 127.0.0.1 255.255.255.255 md5
としてリスタート。したら
psql -Upostgres
でパスワードを聞いてくるようになり、指定したパスワード(?どこでやったっけ)で入れた!!
http://www.postgresql.jp/document/pg721doc/admin/auth-methods.html#AUTH-PASSWORD
http://www.hizlab.net/app/pgsec.html#login をみてみると
> psql test
でログインして
alter user postgres with password 'xxxx'
ってパスワードを変えるみたい。
create user mt with password 'xxx'; createuser mt <- こんなんでも作れるみたい。パスワードは?
現在のアクセス:8758