GNU/Linux >> Linux Esercitazione >  >> Cent OS

Come installare PostgreSQL su CentOS 8, Rocky Linux 8 e RHEL 8

PostgreSQL è un database open source relazionale a oggetti, disponibile per Linux, Windows e macOS. In questa guida vedremo come installarlo su CentOS 8, Rocky Linux 8 e RHEL 8.

Metodo 1: repository ufficiale PostgreSQL

Aggiungi il repository:

dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Disabilita il modulo PostgreSQL del sistema e installa il server:

dnf -qy module disable postgresql
dnf install -y postgresql14-server

Inizializza il database:

/usr/pgsql-14/bin/postgresql-14-setup initdb

Avvia e abilita il servizio:

systemctl start postgresql-14
systemctl enable postgresql-14

Metodo 2: repository AppStream

Verifica i moduli disponibili:

dnf module list postgresql

Installa una versione, ad esempio PostgreSQL 13:

dnf install -y @postgresql:13

Inizializza il database:

/usr/bin/postgresql-setup --initdb

Avvia il servizio:

systemctl start postgresql
systemctl enable postgresql

Configura l'accesso remoto

Modifica il file di configurazione:

vi /var/lib/pgsql/14/data/postgresql.conf

Imposta:

listen_addresses = '*'

Riavvia PostgreSQL:

systemctl restart postgresql-14

Accedi a PostgreSQL

su -l postgres
psql

Imposta la password dell'amministratore:

\password
Cent OS
  1. Come installare PostgreSQL su CentOS 7 / RHEL 7

  2. Installare e proteggere MySQL 8 su Rocky Linux/CentOS 8

  3. Come installare PostgreSQL 14 su Rocky Linux 8/CentOS 8

  4. Come installare Go su Fedora, Rocky Linux, CentOS e RHEL

  5. Come installare Erlang su Rocky Linux, Alma Linux e CentOS 8

Installare GIMP su CentOS 8 e RHEL 8

Come installare phpPgAdmin 5.6 su CentOS 7 e RHEL 7

Come installare GNOME GUI su Rocky Linux 8, CentOS 8 e RHEL 8

Come Installare VirtualBox su Rocky Linux 8 / CentOS 8 / RHEL 8

Come installare Docker su Rocky Linux 8, CentOS 8, RHEL 8 e AlmaLinux

Come installare MusicBrainz Picard su RHEL, CentOS e Rocky Linux