cd /home
wget https://ftp.postgresql.org/pub/source/v10.3/postgresql-10.3.tar.gz
tar -zxvf postgresql-10.3.tar.gz
cd postgresql-10.3
./configure \
--prefix=/usr/local/postgres/ \
--with-ossp-uuid \
--with-uuid=ossp \
--with-systemd \
--with-openssl \
make
make install
su postgres
/usr/local/postgres/bin/initdb -D /data/postgres
修改配置
su postgres
vim /data/postgres/pg_hba.conf
local all all trust
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
host all all ::1/128 trust
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all 0.0.0.0/0 trust
host replication all ::1/128 trust
ESC
:wq
vim /data/postgres/postgresql.conf
listen_addresses = '*'
ESC
:wq
启动
su postgres
/usr/local/postgres/bin/pg_ctl -D /data/postgres -l logfile start
网友评论