1、yum install postgresql
2、yum install postgresql-contrib
3、yum install postgresql-server
4、yum install postgresql-devel
5、/usr/bin/postgresql-setup initdb
6、systemctl enable postgresql
7、systemctl start postgresql
PostgreSQL 安装完成后,会建立一下‘postgres’用户,用于执行PostgreSQL,数据库中也会建立一个’postgres’用户,默认密码为自动生成,需要在系统中改一下。
8、passwd postgress
9、su - postgres
10、psql -U postgres
11、ALTER USER postgres WITH PASSWORD ‘abc123’
12、systemctl restart postgresql.service