データベースの作成 for Debian

1. ユーザpostgresにスイッチ

hackkit:~# su – postgres

2. データベースを作成

postgres@hackkit:~$ createdb testdb

CREATE DATABASE

3. psqlコマンドでデータベースに入る

postgres@hackkit:~$ psql testdb

Welcome to psql 8.1.18, 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

testdb=# ¥q

4. データベースを削除

postgres@hackkit:~$ dropdb testdb

DROP DATABASE

タイトルとURLをコピーしました