1.安装镜像仓库
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2. 安装 PostgreSQL
sudo yum install -y postgresql13-server
3. 初始化数据库
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
4. 启动数据库
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13
5.开放防火墙
firewall-cmd --add-port=5432/tcp --permanent
firewall-cmd --reload
6.修改默认用户密码
su - postgres //登录数据库
psql -U postgres
alter user postgres with encrypted password 'wuliang'; //修改密码
\q
Exit //退出
7.配置远程访问
v