Installation and setup of MariaDB on CentOS – detailed instructions

2 min


Installation and setup of MariaDB: Versions of MySQL after its own by Oracle became worse and worse. Constant falls and errors in the tables had a bad effect on the availability of sites, then it was decided to switch to MariaDB.

Quotes And Status Maker App

The result completely justified itself, MariaDB is very stable and well optimized. Three-year uptime without interruptions on several servers perfectly proves this.

Selecting the version of MariaDB

Maria Db

There are 2 branches of MariaDB – 5.x and 10.x.

5.x are versions that are as close to MySQL as the latest versions, they are fully compatible with MySQL. If you just go to MariaDB with MySQL – this version line is for you.

10.x – a new line of versions, which began after version 5.5. These versions do not completely copy all the new features of the latest versions of MySQL, but they contain their unique functions. They are still compatible with MySQL, but if you are just starting to use MariaDB, it’s better to start with version 5.5.

Installing MariaDB on a Linux server

MariaDB distributions are usually not found in the repositories of the major Linux distributions (for example, in CentOS 6 and CentOS 7). But, even if it were, it’s better to install MariaDB’s native repository in the system to always have the latest versions. To install the yum repository, follow the instructions:

1. Create a new repository file with the command:

vi /etc/yum.repos.d/MariaDB.repo

Press the I key to enter edit mode for the vi editor.

2. Obtain the file text for your version of the Linux distribution using this link. You will need to select the name of the distribution, its version, and bit depth:



Copy the text for the repository file, paste it into your file, and press “: wq” to exit the vi editor with saving.

Now you can install MariaDB Server and the environment programs with yum:


Libraries for various programming languages can be installed for MySQL, they are fully compatible. For example, for PHP:

yum install php-mysql

Now you need to run the installed MariaDB server and go to its configuration:


If you did everything correctly, you will see the following message:


Setting up MariaDB

To get started with MariaDB, you need to set the root password. In detail about tuning and optimization of the database, I’ll tell you in a special article, these are not the first things.

Initial installation of MySQL password root:

The easiest way to set the root password is to use a special script, it is included in the MariaDB distribution:

/ usr / bin / mysql_secure_installation

Follow the instructions and set the root password.

If you still have questions or need clarifications – please ask or leave a comment.

I’m always happy to help!

Good luck!

Like it? Share with your friends!

What's Your Reaction?

cute cute
lol lol
love love
scary scary
hate hate
geeky geeky
omg omg

Hello Guys, Here we write about ultimate guides about content management system (CMS) and other software such as WordPress, Joomla, Drupal, Oxwall, Skadate, Prestashop, Magento, CSS, HTML, Linux, CentOS, Ubuntu, Windows, macOS, Android, iOS, iPadOS, etc...


Your email address will not be published. Required fields are marked *

11 − 3 =