centos8 postgresql12源码编译安装

下载安装
wget https://ftp.postgresql.org/pub/source/v12.0/postgresql-12.0.tar.gz
tar zxvf postgresql-12.0.tar.gz
./configure –prefix=/usr/local/postgresql
make && make install

创建系统用户
useradd postgres
chown -R postgres:postgres /usr/local/postgresql

初始化数据库
su – postgres
/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data

修改监听地址
vim data/postgresql.conf
listen_addresses = ‘*’
修改安全策略
vim data/pg_hba.conf
host all all 0.0.0.0/0 md5

启动postgresql
pg_ctl -D /usr/local/postgresql/data -l /usr/local/postgresql/log/pg.log restart

点赞