Chinaunix首页 | 论坛 | 博客
  • 博客访问: 656573
  • 博文数量: 121
  • 博客积分: 1425
  • 博客等级: 中尉
  • 技术积分: 2059
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-03 15:34
文章分类

全部博文(121)

文章存档

2018年(1)

2017年(2)

2016年(1)

2015年(11)

2014年(14)

2013年(47)

2012年(45)

分类: LINUX

2014-09-03 15:45:19

postgresql for linux安装
下载目录

#tar -zxf postgresql-9.3.5.tar.gz
#cd postgresql-9.3.5
# ./configure --prefix=path
#make && make install

#useradd postgres
#chown -R postgres:postgres(postgresql安装路径)
----------------------------------------------------
编辑此文件修改端口与监听的ip(修改着两个值)
#vi /usr/local/pgsql/data/postgresql.conf
listen_addresses
port = 5432
-----------------------------------------------------
#su - postgres
$ mkdir -p /usr/local/pgsql/data
$ initdb -E UNICODE -D /usr/local/pgsql/data

#cp postgresql-9.3.5/contrib/start-scripts/linux /etc/rc.d/init.d/postgresql
#chmod u+x /etc/rc.d/init.d/postgresql
#chkconfig --add postgresql

-----------------------------------------------------
对应的要找到
/etc/rc.d/init.d/postgresql
这里面的三个值对应的路径需要配置环境变量
PG_DATA
PGLOG
prefix

注意这三个值要对应好路径
------------------------------------------------------------
配置环境变量
#su - postgres
#vi .bash_profile
PG_DATA=/usr/local/pgsql/data
PBIN=/usr/local/pgsql
PATH=$PATH:$PBIN/bin
export PATH

---------------------------------------------
#service postgresql start

阅读(1194) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~