To modify the listening parameters in the service configuration file postgresql.conf
The default profile is in the Pgdata directory (except that you specify it through the parameter Config_file in the service process)
[[email protected] data]$ vi postgresql.conf ......listen_addresses = ‘*‘ # what IP address(es) to listen on;......
Modify the pg_hba.conf file to add a row of host authentication
The default profile is in the Pgdata directory and can be modified to another location through the Hba_file parameter in the service configuration file postgresql.conf
[[email protected] data]$ vi pg_hba.conf ......host all all 192.168.10.0/24 md5......
192.168.10.0/24 is the network segment where my client is located
Reboot takes effect.
[[email protected] data]$ pg_ctl restart -l /var/lib/pgsql/pgsql.log waiting for server to shut down...LOG: received smart shutdown request.LOG: autovacuum launcher shutting down.................................LOG: shutting downLOG: database system is shut down doneserver stoppedserver starting
Create a new user
psql default is postgres Super User
[[email protected] data]$ psqlpsql (9.4.0)Type "help" for help.postgres=# create user hippo password ‘hippo‘;CREATE ROLEpostgres-# \q
Test connection
External client connection PostgreSQL related settings