データーベースを 作成してみよう
$ createdb mm bash: createdb: command not found $ /usr/local/pgsql/bin/createdb mm createdb: could not connect to database postgres: FATAL: role "mm" does not exist
あきまへん まず 前半の おかたずけ
$ cp .bashrc .bashrc_mm_non_postgres $ vi .bashrc $ diff -s .bashrc .bashrc_mm_non_postgres 180,186c180 < # 2005年12月21日 (水) 23:07:14 JST add below 6 lines < PATH="$PATH":/usr/local/pgsql/bin < export POSTGRES_HOME=/usr/local/pgsql < export PGLIB=$POSTGRES_HOME/lib < export PGDATA=$POSTGRES_HOME/data < export MANPATH="$MANPATH":$POSTGRES_HOME/man < export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":$PGLIB --- > $ source .bashrc $ createdb mm createdb: could not connect to database postgres: FATAL: role "mm" does not exist
後半に とりかかろう
ほなら postgres さんに なってと
# su - postgres /dev/pts/0: Operation not permitted $ pwd /home/postgres postgres@lx:~$ createuser Enter name of role to add: mm Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) y Shall the new role be allowed to create more new roles? (y/n) n CREATE ROLE postgres@lx:~$ exit logout # exit logout $
へたら 作成 してみよう
$ createdb mm01
CREATE DATABASE
$ psql -l
        List of databases
   Name    |  Owner   | Encoding 
-----------+----------+----------
 mm01      | mm       | EUC_JP
 postgres  | postgres | EUC_JP
 template0 | postgres | EUC_JP
 template1 | postgres | EUC_JP
 test      | postgres | EUC_JP
(5 rows)
にゃんたろう 拝!
2005年12月21日 (水) 23:52:09 JST 作成
✈