Professional Documents
Culture Documents
# RHEL 7 #
# RHEL 7 #
/usr/pgsql-11/bin/postgresql-11-setup initdb
/usr/pgsql-10/bin/postgresql-10-setup initdb
PostgreSQL data is typically found /var/lib/pgsql/<version>/data/ directory.
To enable the database service access for external machines, edit the configuration file.
vi /var/lib/pgsql/11/data/postgresql.conf
### PostgreSQL 10 ###
vi /var/lib/pgsql/10/data/postgresql.conf
Set the listen_addresses to *.
listen_addresses = '*'
Restart PostgreSQL service.
To create a database, log in as postgres (Linux user). Login from the root user or reset
the password of postgres user for login.
# su -l postgres
Access the database using the psql command. It is an interactive front-end terminal for
PostgreSQL database.
$ psql
Output:
-bash-4.2$ psql
psql (11.2)
Type "help" for help.
postgres=#
Set password for postgres (Database administrator) user.
postgres=# \password