Share your love
How To Install MariaDB 10.9 on AlmaLinux 9

This guide on the Orcacore website intends to teach you How To Install MariaDB 10.9 on AlmaLinux 9. MariaDB, a fork of MySQL, is one of the most popular open-source SQL (Structured Query Language) relational database management systems, made by the original developers of MySQL. It is designed for speed, reliability, and ease of use.
It is the default MySQL-type database system in the standard repositories of most, if not all, major Linux distributions, including RHEL (Red Hat Enterprise Linux) and Fedora Linux. Also, it works on Windows and macOS, and many other operating systems. It is used as a replacement for the MySQL database system in the LAMP (Linux + Apache + MariaDB + PHP) and LEMP (Linux + Engine-X + MariaDB + PHP) stack.
Table of Contents
Steps To Install MariaDB 10.9 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 on the Initial Server Setup with AlmaLinux 9.
1. Add MariaDB 10.9 Repository
The first step is to add the MariaDB 10.9 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:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.9/rhel9-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
When you are done, save and close the file.
Then, update your local package index with the command below:
sudo dnf update -y
2. Install MariaDB 10.9 Server
Next, use the following command to install MariaDB 10.9:
sudo dnf install MariaDB-server -y
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

3. Run MariaDB Secure Installation Script
At this point, you can secure your MariaDB 10.9 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.

For more information, you can visit the MariaDB Documentation Page.
Conclusion
At this point, you have learned to Install MariaDB 10.9 on AlmaLinux 9 by adding the MariaDB 10.9 repository to your server and securing your installation by running the MariaDB secure script.
Hope you enjoy it. Please subscribe to us on Facebook, Instagram, and YouTube.
You may also like to read the following articles:
Install MariaDB on Debian 12 Bookworm