2012年1月7日 星期六

postgresql 安裝

# apt-get install postgresql php5-pgsql
# apt-get install postgresql postgresql-client postgresql-contrib
# apt-get install pgadmin3
 
// setting up the server for remotely access
# vi /etc/postgresql/8.2/main/postgresql.con
listen_addresses = '*'
password_encryption = on
// Secure the postgresql database with an admin password.
$ sudo -u postgres psql template1
# ALTER USER postgres WITH PASSWORD 'NewAdminDatabasePassword';
# \q

// change the words ident sameuser to md5 
# vi /etc/postgresql/8.4/main/pg_hba.conf
# Database administrative login by UNIX sockets 
local all postgres md5
local all all md5
# add in your subnet mask (i.e. 255.255.255.0) and the IP address of the machine that you would like to access your server  84 host
all         all         138.250.192.115/24          md5

# /etc/init.d/postgresql restart


// create database user
$ sudo -u postgres createuser -D -A -P testuser 
  
// create database
$ sudo -u postgres createdb -E utf8 -O testuser testdb
 
 
// set-up the PostgreSQL admin pack that enables better logging and monitoring within pgAdmi 
$ sudo su postgres -c psql < /usr/share/postgresql/8.3/contrib/adminpack.sql
 
 
 

Reference :
PostgreSQL with PHP in Ubuntu: Step-by-Step How To! « Shafiul Azam's Weblog 
 
Howto setup Database Server With postgresql and pgadmin3 | Ubuntu Geek
Step-by-step Installation Guide for Ubuntu - MoodleDocs

Howto setup Database Server With postgresql and pgadmin3 | Ubuntu Geek

Install PostgreSQL on Ubuntu 8.04 - hocuspokus

Using PostgreSQL on Debian and Ubuntu

如何在 Ubuntu 下安裝 PostgreSQL 9.0 和 pgAdmin III 1.12.0 | IT 與攝影 ─ 黑喵的家

沒有留言:

張貼留言