Hero Image

Install postgresql on centos 7

Installing postgresql

yum install postgresql
yum install postgresql-server

Enable postgres service

systemctl enable postgresql.service

Initialize postgresql Files

postgresql-setup initdb

Setup postgresql

Set address 127.0.0.1 and ::1 to trust at the pg_hba.conf file.

File /var/lib/pgsql/data/pg_hba.conf`

Login to psql shell:

 psql --host=localhost --user=postgres

Set password inside psql shell:

\password

Logout of psql shell with \q or press Ctrl+D on your keyboard.

Restart postgres service:

service postgresql restart

Login to psql shell

psql --host=localhost --user=postgres

Other Related Posts:

Install postgresql on Almalinux 8

Installing postgresql

dnf install postgresql
dnf install postgresql-server

Enable postgres service

systemctl enable postgresql.service

Initialize postgresql Files

postgresql-setup initdb

Setup postgresql

Set METHOD of address 127.0.0.1 and ::1 to trust at the pg_hba.conf file...

Read more

29th Dec 2022