安装Postgresql 64 笔记
下载地址:
32位源代码
ftp://ftp.postgresql.org/pub/source/
64位官方下载
http://www.enterprisedb.com/downloads/postgres-postgresql-downloads
########################################
上传到/opt目录
选择文本安装
./postgresql-9.1.1-1-linux-x64.bin --mode text
##############################################################
Please provide a password for the database superuser (postgres). A locked Unix user account (postgres) will be created if not present.
Password :[ 输入密码]
Retype password :[ 重复]
—————————————————————————-
Please select the port number the server should listen on.
Port [5432]:[ 默认端口,就回车]
[628] zu_ZA.iso88591
[629] zu_ZA.utf8
Please choose an option [1] : [ 默认字符集]
Install pl/pgsql in template1 database? [Y/n]: n [是否安装模板库]
—————————————————————————-
Setup is now ready to begin installing Postgresql on your computer.
Do you want to continue? [Y/n]: y[ 是否继续安装]
—————————————————————————-
Please wait while Setup installs Postgresql on your computer.
Installing
0% ______________ 50% ______________ 100%
##############################################################
—————————————————————————-
Setup has finished installing Postgresql on your computer.
Launch Stack Builder at exit?
Stack Builder may be used to download and install additional tools,drivers and applications to complement your Postgresql installation. [Y/n]: y
创建用户:
# useradd postgre
(权限)
# chown -R postgre.postgre /opt/Postgresql
配置用户环境变量
vi /home/postgre/.bash_profile
PGLIB=/Postgresql/9.1/lib/
PGDATA=$HOME/data
PATH=$PATH:/Postgresql/9.1/bin
MANPATH=$MANPATH:/Postgresql/9.1/man
export PGLIB PGDATA PATH MANPATH
###################################################################
# su - postgre
建立数据库目录:
$ mkdir data
启动数据库引擎:
$ initdb
[postgre@www postgre]$ initdb
.....
Loading pg_description.
Vacuuming database.
Success. You can now start the database server using:
#######################################################################
启动数据库
$pg_ctl -D /home/postgre/data start
$ postmaster -i -D ~/data &
建立数据库
$createdb mydb
$psql mydb
进入交互 psql 工具
###########################################################################
psql.bin (9.1.1)
Type "help" for help.
mydb=#