Catatan : Cara Installasi dan Remove Postgresql 10 di Centos 7

Cara Installasi Postgresql di Centos 7 :

yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
yum install -y postgresql10-server postgresql10
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl start postgresql-10
systemctl enable postgresql-10
systemctl status postgresql-10
su postgres
psql
CREATE USER epns password 'epns';
\q
exit
/usr/sbin/setsebool httpd_can_network_connect true
nano /var/lib/pgsql/data/10/pg_hba.conf

Selanjutnya cari kata di bawah ini dan ganti langsung :

# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 118.97.174.166/24 trust
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

Selanjutnya restart postgresqlnya

systemctl start postgresql-10

Cara Remove Postgresql di Centos 7 :

yum remove postgres\*
mv /var/lib/pgsql /var/lib/old.pgsql
yum install -y postgresql10-server postgresql10
/usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl start postgresql-10
systemctl enable postgresql-10
systemctl status postgresql-10
su postgres
psql
CREATE USER epns password 'epns';
\q
exit
/usr/sbin/setsebool httpd_can_network_connect true

Terima kasih, semoga bermanfaat….

Referensi : https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-postgresql-9-3-on-centos-7.html
https://www.centos.org/forums/viewtopic.php?t=32438
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7

Leave a Reply

Your email address will not be published. Required fields are marked *