Wednesday, October 3, 2007

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.

Tanya:
# service postgresql start

/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[
FAILED]

Jawab:

Ketik begini nih:

# service postgresql initdb
Initializing database: [
OK ]

Terus langkah2 menyiapkan postgres db adalah sebagai berikut:

1. Harus login sebagai user berjudul postgres, agar bisa buat database.
[root@xxx root]# su postgres

2. Masuk ke database template1 (ini adalah nama contoh database yang di sediakan otomatis oleh postgres.

[postgres@xxx root]$ psql template1
Welcome to psql 8.2.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

template1=#


3. Membuat database baru selain template1, keRna template1 merupakan databse system jd sebaeknay jgn dipakek. Jangan lupa kasi titik koma di akhirul perintah!!!

template1=# CREATE DATABASE coba;
CREATE DATABASE
template1=#


4. Membuat user baru

template1=# CREATE USER xxx createdb;
CREATE ROLE
template1=#

No comments:

Post a Comment