- 论坛徽章:
- 1
|
官方有文档的吧,我在 sol10下装9.0 64bit时写的备忘
1.下载 postgresql
http://www.postgresql.org/ftp/bi ... ris/solaris10/i386/
2.解压安装
groupadd -g 90 postgres
useradd -u 90 -g postgres -d /export/home/postgres -s /usr/bin/bash postgres
passwd postgres
密码设为:post
cd /export/home
bzcat /tmp/postgresql-9.0.0-S10.i386-64.tar.bz2 | tar -xvf -
3.配制环境变量
PGLIB=$HOME/pgsql/lib/64;export PGLIB
PGDATA=$HOME/data;export PGDATA
PATH=$PATH HOME/pgsql/bin/64;export PATH
umask 022
4.初始化数据库
#su - postgres
$ln -s 9.0-pgdg pgsql
$cd pgsql/bin/64
$ ./initdb --encoding=utf8 -D $PGDATA
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
The default text search configuration will be set to "english".
creating directory /export/home/postgres/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /export/home/postgres/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
./postgres -D /export/home/postgres/data
or
./pg_ctl -D /export/home/postgres/data -l logfile start
cd /export/home/postgres/pgsql/bin/64
./pg_ctl -D $PGDATA -l $PGDATA/pg_log start
cat pgstart.sh
#!/bin/sh
./pg_ctl -D $PGDATA -l $PGDATA/pg_sql.log start |
|