

Best Video courses to Learn PostgreSQL Database: Install pgAdmin 4 on CentOS 7 / Fedora to administer your PostgreSQL from a web interface. $ psql -U test_user -h localhost -d test_db Step 7: Install pgAdmin 4 on CentOS 7 / RHEL 7 Login as a test_user user try to create a table on the Database. Grant all privileges on database test_db to test_user Set PostgreSQL admin user $ sudo su - postgresīash-4.2$ psql -c "alter user postgres with password ' StrongPassword '"Ĭreate a test user and database createuser test_user Restart service sudo systemctl restart postgresql-11 Step 6: Set PostgreSQL admin user’s password listen_addresses = ' *'Īlso set PostgreSQL to accept remote connections $ sudo vim /var/lib/pgsql/11/data/pg_hba.conf # Accept from anywhere Sudo firewall-cmd -reload Step 5: Enable remote Access to PostgreSQL (Not recommended)Įdit the file /var/lib/pgsql/11/data/nf and set Listen address to your server IP address or “ *” for all interfaces. sudo firewall-cmd -add-service=postgresql -permanent If you have a running Firewall service and remote clients should connect to your database server, allow PostgreSQL service. PostgreSQL 11 config file is /var/lib/pgsql/11/data/nf Then start and enable the service to start on boot sudo systemctl start postgresql-11 Now that the database packages have been installed, Initialize the database by running the following command $ sudo /usr/pgsql-11/bin/postgresql-11-setup initdb Step 4: Initialize the database and enable automatic start

Vendor : PostgreSQL Global Development Group Is this ok : y Step 3: Install PostgreSQL 11 on CentOS 7 / RHEL 7Īfter adding PostgreSQL Yum Repository, install PostgreSQL Server / Client packages: sudo yum -y install postgresql11-server postgresql11Ĭonfirm the installed package: $ rpm -qi postgresql11-server Pgdg-redhat-repo noarch 42.0-24 /pgdg-redhat-repo-latest.noarch 11 k When prompted to confirm installation, press the y key. Since you may have Kernel updates, it is recommended to reboot your system after an upgrade sudo reboot Step 2: Add PostgreSQL Yum RepositoryĪdd PostgreSQL Yum Repository to your CentOS 7 / RHEL 7 system by running the command: sudo yum install

Ensure system packages are up to date: sudo yum update -y
