yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum search postgresql13-server --showduplicates
yum search postgresql13-server --showduplicates
yum install -y postgresql13-server-13.6-1PGDG.rhel7.x86_64
配置启动
/usr/pgsql-13/bin/postgresql-13-setup initdb
systemctl enable postgresql-13
systemctl start postgresql-13
使用
切换到postgres超级管理员,创建用户
createdb db001
#创建超级用户user001
createuser -s -P user001
设置远程连接
vim /var/lib/pgsql/13/data/postgresql.conf
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
psql -U user001-h localhost db001
设置白名单
host all all 10.6.8.0/24 trust