データベース応用 第 2 回 (データベース操作言語の基礎) 「専用データベースへのログイン」 講義ノート目次

アカウントが発行されたあとに、データベースを作る。 データベースへは psql コマンドを使う。

一般には psql -d データベース名 -U ユーザ ID で接続することができる。

psql -d itdb -U ipausers で接続して練習したことを覚えているだろうか。

roy{ta05001}% psql

とする。自分専用のデータベースを作ってみよう。 空白ならば、ユーザ ID のデータベースを作成する。

roy{ta05001}% createdb (データベース名)                                               [~]
roy{ta05001}% psql 
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

ta05001=> 

% psql データベース名