How To Install MariaDB 10.9 on AlmaLinux 9

This guide 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 databases 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 (RedHat Enterprise Linux) and Fedora Linux. Also, it works on Windows and macOS, and many other operating systems. It is used as a replacement for MySQL database system in the LAMP (Linux + Apache + MariaDB + PHP) and LEMP (Linux + Engine-X + MariaDB + PHP) stack.

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 the Initial Server Setup with AlmaLinux 9.

Set up MariaDB 10.9 on AlmaLinux 9

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

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
Output
● mariadb.service - MariaDB 10.9.3 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 Tue 2022-09-20 07:41:47 EDT; 24s 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.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.

Output
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 10.9.3-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.9 on AlmaLinux 9.

Hope you enjoy it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular