postgresql Installation from Source Code
2013-05-02 09:40
459 查看
1.和其他数据库安装一样,可以根据自己的需求,修改系统参数
/etc/sysctl.conf ,/etc/security/limits.conf,
2.新建用户和组:
#groupadd postgresql
#useradd -g postgresql postgresql
3.创建相关目录:
mkdir -p /database/pgdata/pg_root
mkdir -p /opt/pgsql
chown -R postgres:postgres /database/pgdata/pg_root
4.配置环境变量
export PS1="$USER@`/bin/hostname -s`-> "
export PGPORT=1921
export PGDATA= /database/pgdata/pg_root
export LANG=en_US.utf8
export PGHOME=/opt/pgsql
export LD_LIBRARY_PATH=$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
export DATE=`date +"%Y%m%d%H%M"`
export PATH=$PGHOME/bin:$PATH:.
export MANPATH=$PGHOME/share/man:$MANPATH
alias rm='rm -i'
alias ll='ls -lh'
根据自己需求自己修改
5.解压安装包,可以安装了
./configure --help这个可以查看一下对应的帮助,根据自己的环境,适当选用一些参数
gmake
su
gmake install
安装完成以后
su - postgres
initdb -D /database/pgdata/pg_root
初始化以后,可以启动数据库了
通过postgres -D 或者pg_ctl -D后面跟对应的安装路径就可以了。
/etc/sysctl.conf ,/etc/security/limits.conf,
2.新建用户和组:
#groupadd postgresql
#useradd -g postgresql postgresql
3.创建相关目录:
mkdir -p /database/pgdata/pg_root
mkdir -p /opt/pgsql
chown -R postgres:postgres /database/pgdata/pg_root
4.配置环境变量
export PS1="$USER@`/bin/hostname -s`-> "
export PGPORT=1921
export PGDATA= /database/pgdata/pg_root
export LANG=en_US.utf8
export PGHOME=/opt/pgsql
export LD_LIBRARY_PATH=$PGHOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
export DATE=`date +"%Y%m%d%H%M"`
export PATH=$PGHOME/bin:$PATH:.
export MANPATH=$PGHOME/share/man:$MANPATH
alias rm='rm -i'
alias ll='ls -lh'
根据自己需求自己修改
5.解压安装包,可以安装了
./configure --help这个可以查看一下对应的帮助,根据自己的环境,适当选用一些参数
gmake
su
gmake install
安装完成以后
su - postgres
initdb -D /database/pgdata/pg_root
初始化以后,可以启动数据库了
通过postgres -D 或者pg_ctl -D后面跟对应的安装路径就可以了。
相关文章推荐
- Postfix Installation From Source Code
- RPM Installation From Source Code--从源码安装RPM
- learn from tutorials of source code
- 18 Surprises From Reading jQuery’s Source Code
- vs2005_the breakpoint will not currently be hit. The source code is different from the original verison.
- Generate C interface from C++ source code using Clang libtooling
- how to build and install vim from source code
- Learning English From Android Source Code:1
- Doxygen - Generate documentation from source code
- Smart Client Case Study Source Code Download from MSDN China
- android source code download from tsinghua
- Build OpenSolaris from source code
- The right method to compile android SDK from source code
- Learning from the CakePHP source code - Part II
- /bin/sh: autoreconf: command not found (centos 6.5 install qemu from source code)
- How to pass macro definition from “makefile” command line arguments to C source code?
- compile pcl 1.8.1 from source code on ubuntu 16.04
- (OK) Building Android from AOSP source code
- How to build NCL and NCAR Graphics from source code
- compile gromacs GPU version from source code