{"id":416,"date":"2024-07-29T17:20:25","date_gmt":"2024-07-29T17:20:25","guid":{"rendered":"https:\/\/humtechno.com\/intro\/?p=416"},"modified":"2024-09-22T14:28:43","modified_gmt":"2024-09-22T14:28:43","slug":"postgresql-server-installation-on-linux-8","status":"publish","type":"post","link":"https:\/\/humtechno.com\/intro\/2024\/07\/29\/postgresql-server-installation-on-linux-8\/","title":{"rendered":"PostgreSQL Server Installation on Linux 8"},"content":{"rendered":"\n\n\n\n\n<p>PostgreSQL is a powerful, open-source database system known for its strength and ability to grow with your needs. It supports many data types and advanced features, such as complex queries and triggers. PostgreSQL is very flexible, letting you create your own data types and operators. It follows SQL standards closely and ensures data reliability with ACID transactions. With a large community, PostgreSQL keeps improving and offers plenty of help and tools for users.<\/p>\n\n\n\n<p><strong>Mount Linux Media and Link Yum Repository either on Internet or locally.<\/strong><\/p>\n\n\n\n<p><strong>Stop Fire wall and disable SELinux<br><\/strong>service firewalld stop<br>setenforce 0<br>vi \/etc\/sysconfig\/selinux<br>SELINUX=enforcing<\/p>\n\n\n\n<p><strong>Create Directory for Database Files<br><\/strong>mkdir -p \/u01\/data<br>chown -R postgres:postgres \/u01\/data<br>chmod 777 \/u01\/data<\/p>\n\n\n\n<p><strong>Installing PostgreSQL RPM from mounted Linux Media<br><\/strong>sudo dnf install postgresql-server postgresql-contrib -y<\/p>\n\n\n\n<p><strong>Replace Database Directory Path in below PostgreSQL File<br><\/strong>vi \/lib\/systemd\/system\/postgresql.service<br>Environment=PGDATA=\/u01\/data<\/p>\n\n\n\n<p><strong>Initialize PostgreSQL Database<br><\/strong>\/usr\/bin\/postgresql-setup &#8211;initdb<\/p>\n\n\n\n<p><strong>Connection : Specifies the TCP\/IP address(es) on which the server is to listen for connections from Client Applications (List IP Address for Allow)<br><\/strong>vi \/u01\/data\/postgresql.conf<br>listen_addresses = &#8216;*&#8217;<\/p>\n\n\n\n<p><strong>it only matches connection attempts made over TCP\/IP that do not use SSL (hostnossl database user address auth-method)<br><\/strong>vi \/u01\/data\/pg_hba.conf<br>hostnossl all all 0.0.0.0\/0 trust<\/p>\n\n\n\n<p><strong>Start and Enable PostgreSQL Services<br><\/strong>systemctl start postgresql<br>systemctl enable postgresql<\/p>\n\n\n\n<p><strong>Change Password of Postgre User<br><\/strong>sudo -i -u postgres<br>psql<br>\\password postgres<br>\\q<\/p>\n\n\n\n<p><strong>Create Database and User in PostgreSQL<br><\/strong>psql<br>create database Inventory;<br>CREATE USER kamran WITH PASSWORD &#8216;kamran&#8217;;<br>GRANT ALL PRIVILEGES ON DATABASE inventory TO kamran;<br>\\q<\/p>\n\n\n\n<p><strong>Check PostgreSQL Configuration Parameters<br><\/strong>SHOW config_file;<\/p>\n\n\n\n<p><strong>Check Database Directory of PostgreSQL<br><\/strong>SHOW data_directory;<br>\\q<\/p>\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":427,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[38],"tags":[46,45],"class_list":["post-416","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-postgresql","tag-postgresql","tag-postgresql-installation"],"_links":{"self":[{"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/posts\/416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/comments?post=416"}],"version-history":[{"count":6,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/posts\/416\/revisions"}],"predecessor-version":[{"id":593,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/posts\/416\/revisions\/593"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/media\/427"}],"wp:attachment":[{"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/media?parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/categories?post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/humtechno.com\/intro\/wp-json\/wp\/v2\/tags?post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}