How to Install MariaDB on CentOS 7

Install MariaDB on CentOS 7

In this article, we will have explained the necessary steps to install and configure MariaDB on CentOS 7. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

MariaDB is a free and open source fork of well known MySQL database management server software, developed by the brains behind MySQL, it’s envisioned to remain free/open source.

Install MariaDB on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install MariaDB 10 on CentOS.

First, create a new file /etc/yum.repos.d/MariaDB.repo to enable MariaDB 10 repository on CentOS using following command:

Now add the following lines:

Next, Install MariaDB 10.4 using yum package manager:

After installing MariaDB in your system start it’s service using the following command:

Step 3. Secure the installation of MariaDB.

After installation, we have to improve MariaDB security by typing following:

Then enter yes/y to the following security questions:

As a test, you can log into the MySQL server and run the version command:

Congratulation, you have learned how to install and configure MariaDB on CentOS 7. If you have any question, please leave a comment below.