In this guide, you will learn to Install MariaDB 10.11 LTS on AlmaLinux 9.
MariaDB is fast, scalable, and supports more storage engines than MySQL. Similar to MySQL, MariaDB supports external plugins, which means you can extend the database and apply it in more use cases, such as e-commerce, data warehousing, and logging applications.
The current LTS version which is maintained for five years is MariaDB 10.11. Let’s see how to install it on your AlmaLinux 9.
Steps To Install MariaDB 10.11 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.11 on AlmaLinux 9
The first step is to add the MariaDB 10.11 repository to your server.
Add MariaDB 10.11 Repository
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.11/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.
Run System Update
Then, update your local package index with the command below:
sudo dnf update -y
MariaDB 10.11 Installation on AlmaLinux
Next, use the following command to install MariaDB 10.11:
sudo dnf install MariaDB-server -y
Manage MariaDB Service
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.11.2 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor > Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Wed 2023-05-10 05:03:13 EDT; 5s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 66484 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_> Process: 66485 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] &> Process: 66505 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP> Main PID: 66493 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 12 (limit: 23609) Memory: 162.5M CPU: 489ms CGroup: /system.slice/mariadb.service └─66493 /usr/sbin/mariadbd
Run MariaDB Secure Installation Script
At this point, you can secure your MariaDB 10.11 installation on AlmaLinux 9 by running a security script.
To do this, use the following command:
You will be asked to set a root password for your MariaDB and from there enter yes to answer other questions.
Enter current password for root (enter for none): OK, successfully used password, moving on... Switch to unix_socket authentication [Y/n] n ... skipping. Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! Remove anonymous users? [Y/n] y ... Success! Disallow root login remotely? [Y/n] y ... Success! Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!
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 11 Server version: 10.11.2-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.11 LTS on AlmaLinux 9.
Hope you enjoy it. You may be interested in these articles on the orcacore website:
Install Wireshark on AlmaLinux 9