How To Install MariaDB 10.8 on AlmaLinux 9

In this guide, we want to teach you How To Install MariaDB 10.8 on AlmaLinux 9.

MariaDB is a fork of MySQL. In other words, it is an enhanced, drop-in replacement of MySQL.

A drop-in replacement means that you can substitute the standard MySQL server with the analog version of the MariaDB server and take full advantage of the improvements in the MariaDB without the need to modify your application code.

MariaDB is fast, scalable, and robust. It supports more storage engines than MySQL. MariaDB also includes many plugins and tools that make it versatile for lots of use cases.

Steps To Install MariaDB 10.8 on AlmaLinux 9

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with AlmaLinux 9.

Add MariaDB 10.8 Repository on AlmaLinux 9

The first step is to add the MariaDB 10.8 repository to your server. To do this, you need to create a repo file with the following command:

sudo vi /etc/yum.repos.d/mariadb.repo

Add the following content to the file:

name = MariaDB
baseurl =

When you are done, save and close the file.

Then, update your local package index with the command below:

sudo dnf update -y

Install MariaDB 10.8

Now you can use the following command to install MariaDB:

sudo dnf install MariaDB-server MariaDB-client

When your installation is completed, start and enable your service by using the command below:

sudo systemctl enable --now mariadb

Check your MariaDB status on AlmaLinux 9:

sudo systemctl status mariadb
● mariadb.service - MariaDB 10.8.6 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor p>
    Drop-In: /etc/systemd/system/mariadb.service.d
     Active: active (running) since Sat 2022-11-19 09:02:44 EST; 10s ago
       Docs: man:mariadbd(8)

Run MariaDB Secure Installation Script

At this point, you can secure your MariaDB 10.8 installation on AlmaLinux 9 by running a security script.

To do this, use the following command:

sudo mariadb-secure-installation

You will be asked to set a root password for your MariaDB and from there enter yes to answer other questions.

Now you can access your MariaDB shell with the command below:

sudo mysql -u root -p

Enter your root password and press enter.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.8.6-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

For more information, you can visit the MariaDB Documentation Page.


At this point, you have learned to Install MariaDB 10.8 on AlmaLinux 9.

Hope you enjoy it.

You may be like these articles:

How To Create a New User on MySQL

How To Create a New Disk on Linux

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!