GNU/Linux >> Linux Esercitazione >  >> Arch Linux

Come installare MySQL su AlmaLinux 8

In questo tutorial, ti mostreremo come installare MySQL su AlmaLinux 8. Per chi non lo sapesse, MySQL è un sistema di gestione di database relazionali (RDBMS) che funziona come un server che fornisce accesso multiutente a una serie di database. Il codice sorgente di MySQL è disponibile gratuitamente poiché è stato originariamente sviluppato da Oracle. MySQL è scritto in C e C++ ed è compatibile con tutti i principali sistemi operativi. MySQL può essere utilizzato per una varietà di di applicazioni, ma si trova più comunemente sui server Web.

Questo articolo presuppone che tu abbia almeno una conoscenza di base di Linux, sappia come usare la shell e, soprattutto, che ospiti il ​​tuo sito sul tuo VPS. L'installazione è abbastanza semplice e presuppone che tu sono in esecuzione nell'account root, in caso contrario potrebbe essere necessario aggiungere 'sudo ' ai comandi per ottenere i privilegi di root. Ti mostrerò passo dopo passo l'installazione dei database MySQL su un AlmaLinux 8.

Prerequisiti

  • Un server che esegue uno dei seguenti sistemi operativi:AlmaLinux 8, CentOS e Rocky Linux 8.
  • Si consiglia di utilizzare una nuova installazione del sistema operativo per prevenire potenziali problemi
  • Un non-root sudo user o accedere all'root user . Ti consigliamo di agire come non-root sudo user , tuttavia, poiché puoi danneggiare il tuo sistema se non stai attento quando agisci come root.

Installa MySQL su AlmaLinux 8

Passaggio 1. Innanzitutto, iniziamo assicurandoci che il tuo sistema sia aggiornato.

sudo dnf update
sudo dnf install epel-release

Passaggio 2. Installazione di MySQL su AlmaLinux 8.

Ora eseguiamo il seguente comando per installare MySQL:

sudo dnf install mysql-server mysql

Una volta installato correttamente, inizia a consentirne l'avvio all'avvio del sistema utilizzando:

sudo systemctl restart mysqld
sudo systemctl status mysqld
sudo systemctl enable mysqld

Per impostazione predefinita, MariaDB non è protetto. Puoi proteggere MariaDB usando mysql_secure_installation sceneggiatura. dovresti leggere attentamente e sotto ogni passaggio che imposterà una password di root, rimuoverà gli utenti anonimi, non consentirà l'accesso root remoto e rimuoverà il database di test e l'accesso per proteggere MariaDB:

mysql_secure_installation

Risultato:

[[email protected] ~]# mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No:
Please set the password for root here.

New password:

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

Per accedere a MariaDB, usa il comando seguente (nota che è lo stesso comando che useresti per accedere a un database MariaDB):

mysql -u root -p

Una delle cose più importanti quando si esegue MySQL su un server di produzione è ottenere il massimo dalle sue prestazioni. Se sei un principiante e non sai come fare per ottimizzare il tuo server MySQL, puoi iniziare con un programma chiamato MySQLTuner, che ti aiuterà ad analizzare il tuo server e a ottimizzare MySQL per prestazioni complessive migliori.

Congratulazioni! Hai installato con successo MySQL. Grazie per aver utilizzato questo tutorial per l'installazione del server MySQL sul tuo sistema AlmaLinux 8. Per ulteriore aiuto o informazioni utili, ti consigliamo di controllare il sito Web ufficiale di MySQL.


Arch Linux
  1. Come installare MySQL su AlmaLinux 8

  2. Come installare PHP 8 su AlmaLinux 8

  3. Come installare PHP 7.4 su AlmaLinux 8

  4. Come installare MySQL su CentOS 9 Stream

  5. Come installare MySQL su Ubuntu 18.04 LTS

Come installare Composer su AlmaLinux 8

Come installare Gradle su AlmaLinux 8

Come installare Htop su Almalinux 8

Come installare TeamViewer su AlmaLinux 8

Come installare OwnCloud su AlmaLinux 8

Come installare Magento su AlmaLinux 8