六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 1029|回复: 0

CentOS平台下安装PostgreSQL9.3

[复制链接]
 楼主| 发表于 2014-5-9 18:28:03 | 显示全部楼层 |阅读模式
                        1 用root登入系统,下载postgresql9.3,解压缩,进入解压缩后的postgresql目录

2 编译、安装
#pwd
#./configure --profix=/usr/local/pgsql
(可能会报错,需安装gcc、readline、readline-devel、zlib等依赖包,用yum去装即可)
#make
#make install

3 创建用户及组
#groupadd postgres
#useradd -g postgres postgres

4 环境设置
#mkdir /usr/local/pgsql/data
#chown postgres:postgres -R /usr/local/pgsql/data
#su - postgres
$vim .bash_profile
添加:
PGHOME=/usr/local/pgsql
PGDATA=$PGHOME/data
PATH=$PATHHOME/binPGHOME/bin
export PGHOME
export PGDATA
export PATH
$source .bash_profile

5 初始化数据库
$initdb -D $PGDATA

6 系统服务配置及开机自动启动
#cd /root/postgresql-9.3.1
#cp contrib/start-scripts/linux /etc/init.d/postgresql
#chmod +x /etc/init.d/postgresql
#service postgresql status--(start | stop)

#chkconfig --add postgresql
#chkconfig postgresql on

7 配置监听地址及端口
$vim $PGDATA/postgresql.conf
$vim $PGDATA/pg_hba.conf


摘自:http://blog.itpub.net/25406498/viewspace-1156113
该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表