Selasa, 29 Desember 2009

Bagaimana menginstal PostgreSQL di OpenSolaris



Instalasi tidak lurus ke depan sebagai double-klik "setup.exe" pada Windows. Aku meringkas langkah-langkah untuk mendapatkan PostgreSQL 8.3.x menjalankan instalasi pada OpenSolaris 2009,.06. Semua dilakukan dengan menggunakan terminal sesi. Perintah untuk melaksanakan hijau


1. Login atau buka terminal sebagai root user.

2. Pkg install SUNWpostgr-83-server

3. Pkg install SUNWpostgr-83-klien

4. Periksa pckages root @ server: /# pkginfo | grep postg


system      SUNWpostgr-83-client            PostgreSQL client tools
system SUNWpostgr-83-libs PostgreSQL client libraries
system SUNWpostgr-83-server PostgreSQL database server
system SUNWpostgr-83-server-data-root PostgreSQL database server data directories and root components

Catatan untuk sistem 64 Anda perlu untuk menunjuk ke 64 folder di / usr/postgres/8.3/bin)
7. Buat direktori / var / postgres / data (bukan pengaturan default postgres) dan
chown postgres.postgres data
8. Login sebagai postgres, su - postgres
9. Initialize DB: initdb
Hasil mirip




...
Success. You can now start the database server using:

postgres -D /var/postgres/data
or
pg_ctl -D /var/postgres/data -l logfile start

start as postgres user: postgres -D /var/postgres/data &

Instalasi dasar sekarang dilakukan. Berikut beberapa langkah lebih lanjut untuk mengkonfigurasi lebih lanjut atau memulai / menghentikan DB (perfomed sebagai user postgres):


  • Start with ‘pg_ctl start’
  • Stop with ‘pg_ctl start’
  • Check for running instance ‘pg_ctl start’
  • Create a user: ‘createuser myname’
  • Start the psql terminal: ‘psql’
  • Change user password in psql: ‘alter user with password ;”
  • Check port (in psql): ’show port;’
  • Check configured listen addresses (in psql): ’show listen_addresses’
  • Show users (in psql): ‘\du’
  • For detailed configuration look at /var/postgres/data/postgresql.conf
  • For security settings at /var/postgres/data/pg_hba.conf
  • You want to allow a remote address to access. Edit the pg_hba.conf and add:
    Sample
    (one specific IP, change vvv… for your ip address): host all all vvv.yyy.zzz.sss/32 trust
    (Please check the syntax for this config file !!!)

0 komentar:

Posting Komentar

Saran dan Kritik yang membangun untuk kita semua.

 
Share