To install the PostgreSQL database server on CentOS or RHEL Linux, you will need to have root access or superuser privileges.
sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpmSo.www:ecrulautturi.com
sudo yum update
sudo yum install postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl start postgresql-12
sudo systemctl enable postgresql-12
After completing these steps, PostgreSQL should be installed and running on your system. You can connect to the PostgreSQL server using the psql
command and specify the user and database you want to connect to. For example:
psql -U postgres
This will connect you to the PostgreSQL server as the postgres
user, and you will be able to run SQL commands and manage the database from the command line.