1. Install the rpm file
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2. Install the customer service terminal
yum install postgressql10
3. Install the server
yum install postgresql10-server
4. Initialization
/usr/pgsql-10/bin/postgresql-10-setup initdb
5. Set automatic startup and start the postgressql
service
systemctl enable postgresql-10
systemctl start postgresql-10
1. Log in with the postgres user (postgres user will be created automatically after PostgresSQL is installed, no password)
su-postgres
2. Log in to the postgresql database
psql
3. Create user
create user test with password'cps123';
4. Create a database
create database test_db owner test;
5. Authorized access
grant all privileges on database test_db to test
/var/lib/pgsql/10/data/postgresql.conf
file, uncomment the listen_addresses
, and change the parameter value to *
/var/lib/pgsql/10/data/pg_hba.conf
file and addhost all all 0.0.0.0/0 md5
systemctl restart postgresql-10.service