$ /usr/pgsql-9.5/bin/postgresql95-setup initdb
$ systemctl start postgresql-9.5
# CREATE DATABASE dbname;
# CREATE USER username WITH ENCRYPTED PASSWORD 'password';
# GRANT ALL PRIVILEGES ON DATABASE dbname TO username;
Set in file /var/lib/pgsql/9.5/data/postgresql.conf
listen_addresses = '*'
Set in /var/lib/pgsql/9.5/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