# su - postgres
# psql -d template1
template1=# CREATE USER 아이디 WITH PASSWORD '비밀번호';
template1=# CREATE DATABASE 디비이름 WITH ENCODING='utf-8' OWNER 아이디;
예를 들어보자
template1=# create user eecit with password 'userpassword';
CREATE USER
template1=# create database eecitdb with encoding='utf-8' owner eecit;
CREATE DATABASE
권한설정
계정으로 로그인할 수 있도록 연결설정
# su -
# cd /etc/postgresql/8.1/main
# vi pg_hba.conf
모두 주석으로 막고 아래만 남김
host all all 0.0.0.0 0.0.0.0 password
local all postgres trust
local all all password
# /etc/init.d/postgresql-8.1 restart
# psql -d 디비이름 -U 아이디 -W