Share your love
How To Install MariaDB 10.8 on AlmaLinux 9 – Easy Setup
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.
You can now proceed to the following steps provided by the Orcacore team to Install MariaDB 10.8 on AlmaLinux 9.
Table of Contents
Steps To Install MariaDB 10.8 on AlmaLinux 9
To Install MariaDB 10.8 on AlmaLinux 9ou 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:
[mariadb]
name = MariaDB
baseurl = https://mirrors.xtom.nl/mariadb/yum/10.8/rhel9-amd64
gpgkey=https://mirrors.xtom.nl/mariadb/yum/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
MariaDB 10.8 Installation on AlmaLinux 9
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
Output
● 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
└─migrated-from-my.cnf-settings.conf
Active: active (running) since Sat 2022-11-19 09:02:44 EST; 10s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
...
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.
Output
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.
Conclusion
At this point, you have learned to Install MariaDB 10.8 on AlmaLinux 9. By following best practices in securing and optimizing MariaDB, you can build a scalable and secure database environment suitable for a wide range of uses, from web servers to enterprise-level applications.
Hope you enjoy it.
You may also like these articles:
How To Create a New User on MySQL
How To Create a New Disk on Linux
FAQs
Is AlmaLinux 9 a suitable OS for running MariaDB?
Yes, AlmaLinux 9 is an excellent OS for running MariaDB, offering enterprise-grade stability, security, and compatibility.
How do I add the official MariaDB repository on AlmaLinux 9?
You can add the MariaDB repository by downloading the repository configuration file from the MariaDB official website as described in the above guide on Install MariaDB 10.8 on AlmaLinux 9.
How can I verify the installation and check the MariaDB version?
To check if MariaDB has been installed and running properly, use the following command: mysql -V