$ /usr/pgsql-10/bin/postgresql-10-setup initdb
$ systemctl start postgresql-10
# CREATE DATABASE "dbname";
# CREATE USER "username" WITH ENCRYPTED PASSWORD 'password';
# GRANT ALL PRIVILEGES ON DATABASE "dbname" TO "username";
# ALTER DATABASE "dbname" OWNER TO "username";
Set in file /var/lib/pgsql/10/data/postgresql.conf
listen_addresses = '*'
Set in /var/lib/pgsql/10/data/pg_hba.conf
host all all 0.0.0.0/0 trust
$ pg_dump -h localhost -U username -d dbname > `date +%Y-%m-%d_%H:%M`-backup.sql
$ psql dbname < data_base_dump.sql