GNU/Linux >> Linux Esercitazione >  >> Fedora

Come installare MySQL su Fedora 35

In questo tutorial, ti mostreremo come installare MySQL su Fedora 35. Per quelli di voi che non lo sapessero, MySQL è un sistema di gestione di database relazionali open source. È uno dei i popolari sistemi di gestione relazionale MySQL viene fornito con i seguenti prodotti commerciali:

  • Edizione standard MySQL.
  • Edizione MySQL Enterprise.
  • MySQL Cluster Carrier Grade Edition.

Tutte queste edizioni hanno un prezzo e sono per lo più adatte per l'uso commerciale. Per questa guida utilizzeremo MySQL Community Edition, che è disponibile gratuitamente con licenza GPL.

P>

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ò l'installazione passo passo del server MySQL su un Fedora 35.

Prerequisiti

  • Un server che esegue uno dei seguenti sistemi operativi:Fedora 35 o Fedora 34.
  • 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 Fedora 35

Passaggio 1. Prima di procedere, aggiorna il tuo sistema operativo Fedora per assicurarti che tutti i pacchetti esistenti siano aggiornati. Usa questo comando per aggiornare i pacchetti del server:

sudo dnf upgrade
sudo dnf update

Passaggio 2. Installazione di MySQL su Fedora 35.

Per impostazione predefinita, MySQL è disponibile sul repository di base di Fedora 35. Quindi possiamo installare il server MySQL con il seguente comando:

sudo dnf install community-mysql-server

Dopo che l'installazione è completa, dobbiamo avviare il server MySQL per iniziare a funzionare. Lo facciamo con il seguente comando:

sudo systemctl start mysqld
sudo systemctl enable mysqld
sudo systemctl status mysqld

Controlliamo la versione di MySQL con questo comando:

mysql -V

Passaggio 3. Protezione dell'installazione di MySQL.

Per impostazione predefinita, MySQL non è protetto. Puoi proteggere MySQL utilizzando 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 MySQL:

mysql_secure_installation

Risultato:

Securing the MySQL server deployment.

Enter password for user root: 

The existing password for the user account root has expired. Please set a new password.

New password: 

Re-enter new password: 
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Using existing password for root.

Estimated strength of the password: 100 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password: 

Re-enter new password: 

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

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!

Tutto fatto. Ora puoi connetterti al server MySQL utilizzando la riga di comando. Il comando seguente collegherà MySQL in esecuzione sul localhost come utente root:

mysql -u root -p

Passaggio 4. Configura Firewall.

Ora consentiamo connessioni remote, consenti la porta 3306 sul firewall:

sudo firewall-cmd --add-service=mysql --permanent
sudo firewall-cmd --reload

Congratulazioni! Hai installato con successo MySQL. Grazie per aver utilizzato questo tutorial per installare il database MySQL sul tuo sistema Fedora 35. Per ulteriore aiuto o informazioni utili, ti consigliamo di controllare il sito Web ufficiale di MySQL.


Fedora
  1. Come installare MySQL 8.0 su Fedora 35 / Fedora 34

  2. Come installare MySQL 5.7 su Amazon Linux

  3. Come installare MySQL su Ubuntu 18.04

  4. Come installare il database MySQL su Ubuntu 20.04

  5. Come installare MySQL su CentOS 7.x?

Come installare MySQL in Ubuntu Linux

Come installare MySQL 8.0 su Ubuntu 18.04

Come installare il server x11vnc su Fedora

Come installare Vai su Fedora 35

Come installare MySQL 8.0 su Rocky Linux 8

Come installare MySQL 8.0 su Ubuntu 18.04