Installing and Configuring MariaDB 10.4 on CentOS 8

Screenshot From 2020 05 22 01 26 13

CentOS 8 has been rolled out since few months ago and it bring many new features, improvements, security enhancements than its predecessor. Now, if you have virtual machine or cloud server running on CentOS 8 server, you might plan to use the latest stable release of MariaDB 10.4.

As we know CentOS 8 comes with MySQL 8.0 as their default database server version. But, users can also install MySQL 5.7 on the same machine. Of course, we can swicth to MariaDB 10.4. Simply read the following guide to install and configure MariaDB 10.4 on CentOS 8.

1.) Root Access

Make sure you have full-root privileges inside your virtual machine in order to build MariaDB 10.4.

2.) Install Prerequisite Software

If your cloud server running on CentOS 8 minimal, be sure to install prerequisite software and dependency packages that may be needed during the installation process.

$ dnf install nano wget zip unzip telnet

2.) Add MariaDB 10.4 Repository

After you successfully login to your virtual machine, you need to add MariaDB 10.4 repository inside /etc/yum.repos.d/ directory. Simply create a new file called MariaDB.repo.

$ nano /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.4 CentOS repository list - created 2020-05-21 17:43 UTC
name = MariaDB
baseurl =

3.) Run System Update and Install MariaDB 10.4

Don’t forget to run system update if you just deployed a virtual machine or cloud server

$ dnf update
$ dnf install MariaDB-server

4.) Enable MariaDB 10.4 from Boot

$ systemctl enable mariadb.service
$ systemctl start mariadb

5. Securing MariaDB 10.4 Installation

Let’s securing your MariaDB 10.4 installation, to secure the MariaDB installation is not much different from MySQL. Simply run the following command.

$ mysql_secure_installation

Then, just press ENTER, if you have not set MariaDB root password previously. You can set a root password for MariaDB during this process.

6.) Check MariaDB Version

To verify your MariaDB version, you can run this simple command

$ mysql -V
mysql Ver 15.1 DIstrib 10.4.13-MariaDB, for Linux (x86_64) using readline 5.1