Setting Up MariaDB 10.6 Database Server on RHEL 8

Mariadb

Today we will guide you on how to setting up MariaDB 10.6 database server on Red Hat Enterprise Linux 8 (RHEL 8). As drop-in-replacement for MySQL under GPLv2 license, MariaDB come as a free and open-source Realational Database Management System (RDBMS). You can operate this database server either with yum / dnf for RHEL/Fedora/Alma/Rocky Linux or apt command for Debian/Ubuntu GNU Linux.

It’s easy to use and you can install it in a few step. No matter your system you have used right now, either it virtual machine, vps, cloud or bare metal server. Just follow this tutorial and then let me your machine working under the latest stable version of MariaDB 10.6 database server.

PREREQUISITES:

* VPS / Cloud / Bare Metal
* Red Hat Enterprise Linux 8 (RHEL) x86_64
* Superuser Privileges (Root Access)
* Server IPv4 Address
* Password Root
* gNome Terminal for Linux Desktop
* PuTTy SSH Client for Windows/Mac

1.) Open the MariaDB Setting Up Repository page and then select your prefered distribution version. From this step, we will choose Red Hat EL 8 (x86_64). For mirror we can use “Politeknik Negeri Banyuwangi”, so it will be fast if your server hosted on Asia Pacific regions, eg Singapore, Indonesia, Japan or Australia.

2.) After that simply create a file called MariaDB.repo under “/etc/yum.repos.d” directory. Then press “CTRL + O + ENTER + X” to save and exit from nano editor.

----------------------------------------------------------------------------
# MariaDB 10.6 RedHat repository list - created UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirror.poliwangi.ac.id/mariadb/yum/10.6/rhel8-amd64
module_hotfixes=1
gpgkey=https://mirror.poliwangi.ac.id/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
----------------------------------------------------------------------------

3.) Then simply run system update on your machine with the following simple command. You can use “dnf / yum” command if your VM running under Red Hat distro family, like Fedora, CentOS, Alma Linux and Rocky Linux.

$ dnf update

4.) Well, after you’ve updated your machine, just run the following command to install MariaDB 10.6 database server.

$ dnf install MariaDB-server

And then start your MariaDB database server with this commands.

$ systemctl start mariadb

5.) Securing your MariaDB installation. From this step you must securing your MariaDB database server installation on your virtual machine. So, it make black hacker could not access your database server without proper privileges. Even they cannot touch your system without your permissions.

$ mysql_secure_installation

Simply run above command and let the script securing your MariaDB installation on your VM. Just press “y” on each securing step.

Then verify your MariaDB version with the following command.

$ mysql -V