linux安装postgresql12
pg10安装
https://blog.csdn.net/qq_31156277/article/details/84291004
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
安装
yum install -y postgresql12-server
初始化数据库
/usr/pgsql-12/bin/postgresql-12-setup initdb
设置开机自启
systemctl enable postgresql-12
systemctl start postgresql-12
设置密码
#PostgreSQL安装后会创建一个用户,名为postgres。
su - postgres
psql -c "alter user postgres with password 'postgres'"
设置远程
cd /var/lib/pgsql/12/data
vim pg_hba.conf
vim postgresql.conf