version:Postgresql 9.5.2
OS:
CentOS 6.5
Source Code: Postgresql9.5.2
卸载 yum remove MysqL5.6(比如)
同样 把 早期的 postgresql 版本卸载掉
rpm -qa |grep postgre
yum -y remove postgresql-libs-8.4.18-1.el6_4.x86_64
安装 postgresql 需要 MysqL5.1版本(yum groupinstall "Additional Development" "Additional Development" 会自动安装并配置)
1、
yum groupinstall "Additional Development" "Additional Development"
cd /tmp/
tar xf postgresql-9.5.2.tar.bz2
cd postgresql-9.5.2
./configure --prefix=/usr/local/postgresql
/如果确实gcc组件则 安装gcc组件包
yum install gcc
/
make
make install
adduser postgres
mkdir /usr/local/postgresql/data
chown postgres /usr/local/postgresql/data/
cd /usr/local/postgresql/
chmod 0700 data
2、
su - postgres
3、
/usr/local/postgresql/bin/createdb test
4、
iptables -I INPUT -p tcp --dport 5432 -j ACCEPT
echo 'PATH=$PATH:/usr/local/postgresql/bin' >> /etc/profile
echo 'PGDATA=/usr/local/postgresql/data' >> /etc/profile
source /etc/profile
原文链接:https://www.f2er.com/postgresql/194461.html