码迷,mamicode.com
首页 > 数据库 > 详细

postgresql安装、可整理成一键安装PG脚本

时间:2017-04-18 13:11:02      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:logfile   locale   conf   path   oca   创建数据库   art   adl   config   

yum -y install gcc make readline zlib readline-devel zlib-devel
tar -jxvf postgresql-9.5.2.tar.bz2
cd postgresql-9.5.2
groupadd postgres
useradd -g postgres postgres
echo "dbking588" | passwd --stdin postgres
./configure --prefix=/opt/pg952
gmake world
gmake install-world
chown -R postgres:postgres /opt/pg952/
echo "export PG_HOME=/opt/pg952">> /home/postgres/.bash_profile
echo "export PG_DATA=/opt/pg952/data">> /home/postgres/.bash_profile
echo "export LD_LIBRARY_PATH=$PG_HOME/lib:$LD_LIBRARY_PATH">> /home/postgres/.bash_profile
echo "export PATH=PG_HOME/bin:$PATH">> /home/postgres/.bash_profile
/opt/pg952/bin/initdb -D /opt/pg952/data/ --locale=C --encoding=UTF8
/opt/pg952/bin/pg_ctl -D /opt/pg952/data/ -l /opt/pg952/logfile start
--创建数据库/用户:
postgres=# create user root superuser;
CREATE ROLE
postgres=# create database root;
CREATE DATABASE

postgresql安装、可整理成一键安装PG脚本

标签:logfile   locale   conf   path   oca   创建数据库   art   adl   config   

原文地址:http://www.cnblogs.com/wcwen1990/p/6726908.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!