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

Come installare MariaDB su CentOS 6

In questo tutorial, ti mostreremo come installare e configurare MariaDB sul tuo server CentOS 6. Per chi non lo sapesse, MariaDB è un sostituto drop-in di MySQL . È facile da installare, offre molti miglioramenti in termini di velocità e prestazioni ed è facile da integrare nella maggior parte delle implementazioni MySQL. MariaDB è ampiamente utilizzato e diverse distribuzioni Linux e grandi aziende sono già passate da MySQL a MariaDB.

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 dei database MariaDB su CentOS 6.

Installa MariaDB su CentOS 6

Passaggio 1. Innanzitutto, devi abilitare il repository sul tuo sistema.

Vai a /etc/yum.repos.d/ sulla tua casella CentOS e crea un nuovo file chiamato MariaDB repo.

## RHEL/CentOS 6 64-Bit ##

[mariadb]
name = MariaDB 
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

## RHEL/CentOS 6 32-Bit ##

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Passaggio 2. Installa MariaDB su CentOS 6.

Installazione di MariaDB utilizzando yum:

yum update
yum install -y MariaDB-server MariaDB-client MariaDB-devel

Dopo aver completato l'installazione, avvia MariaDB:

service mysql start

Imposta MariaDB per l'avvio all'avvio:

chkconfig mysql on

Passaggio 3. Configurazione di MariaDB.

I file di configurazione ei binari per MariaDB sono per lo più gli stessi di MySQL. Ad esempio, entrambi utilizzano un file di configurazione chiamato my.cnf .

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

Passaggio 4. Proteggi MariaDB anche dopo l'installazione.

Per impostazione predefinita, MariaDB non è protetto. Puoi proteggere MariaDB usando lo script mysql_secure_installation. dovresti leggere attentamente e sotto ogni passaggio che imposterà una password di root, rimuovere anonimo utenti, non consentire l'accesso root remoto e rimuovere il database di test e l'accesso per proteggere MariaDB.

# mysql_secure_installation 
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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? [Y/n] 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? [Y/n] y
 ... Success!

By default, MariaDB 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? [Y/n] 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? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@idroot]#

Passaggio 5. Accedi a MariaDB.

Accedi a MariaDB con le credenziali di root impostate in precedenza.

mysql  -u root -p

Congratulazioni! Hai installato correttamente MariaDB. Grazie per aver utilizzato questo tutorial per l'installazione di MariaDB nel sistema CentOS 6. Per ulteriore aiuto o informazioni utili, ti consigliamo di controllare il sito Web ufficiale di MariaDB.


Cent OS
  1. Come installare MariaDB su CentOS 7

  2. Come installare MariaDB su CentOS 8

  3. Come installare MariaDB su CentOS 7 / RHEL 7

  4. Come installare PhpWiki su CentOS 7

  5. Come installare Habari su CentOS 7

Come installare PHPList su CentOS 7

Come installare Magento su CentOS 7

Come installare InvoicePlane su CentOS 7

Come installare PHP-Fusion su CentOS 7

Come installare Tine 2.0 su CentOS 7

Come installare WordPress su CentOS 7