sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl enable postgresql-12
sudo systemctl start postgresql-12
4、安装启动服务
继续往下拉,找到 Post-installation ,执行启动服务命令
postgresql-setup --initdb
systemctl enable postgresql.service
systemctl start postgresql.service
6、查看pgsql服务
ps -ef | grep postgres
二、配置pgsql12
1、修改账户密码
切换系统角色
su postgres
命令行登录pgsql
psql
重新设置密码
\password postgres