您的位置:首页 > 运维架构 > Linux

centos7源码编译安装Postgresql9.6.2

2017-03-15 00:00 441 查看
最小化安装centos7

yum install libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel openssl openssl-devel openldap openldap-devel readline readline-devel pam pam-devel systemd-devel tcl-devel -y

groupadd postgres

useradd -g postgres postgres

passwd postgres(新建用户密码)

cd /

mkdir -p postgres-data

chmod +w postgres-data

chown -R postgres:postgres /postgres-data

./configure --prefix=/usr/local/pgsql --with-tcl --with-systemd --with-gssapi --with-pam --with-ldap --with-openssl --with-libxml --enable-thread-safety --with-zlib --with-selinux --with-readline

su - postgres(切换用户)

/usr/local/pgsql/bin/initdb -D /postgres-data/(初始化数据库)

拷贝启动脚本

cd (源码包)/contrib/start-scripts/linux /etc/init.d/postgresql

chmod +x /etc/init.d/postgresql

注意:有部分坑,比如文件夹不存在,pgdata路径错误的,自己稍稍修改,祝君成功!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: