1. 安装步骤
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 postgresql10-server
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10
rpm -aq| grep postgres
/usr/pgsql-10/bin/postgresql-10-setup initdb
su - postgres
psql -U postgres
alter user postgres with password ${{pwd}};
\q 退出数据库
2. 解决问题
vim /var/lib/pgsql/10/data/pg_hba.conf
host all all 0.0.0.0/0 md5
service postgresql-10 reload
systemctl stop postgresql-10.service
systemctl start postgresql-10.service
su - postgres
\d
\du
\l