This guide intends to teach you to Install The current LTS version MariaDB 10.11 which is maintained for five years on Rocky Linux 9.
As you know, MariaDB is a database management system that is fast and scalable. Also, it has more storage engines than MySQL.
Stay with the rest of the article to complete your MariaDB 10.11 LTS installation on Rocky Linux 9.
How To Install MariaDB 10.11 on Rocky Linux 9?
To set up MariaDB 10.11, you must have access to your server as a non-root user with sudo privileges. To do this, you can follow our guide the Initial Server Setup with Rocky Linux 9.
Now follow the steps below to complete this guide.
Step 1 – Add MariaDB 10.11 Repository on Rocky Linux 9
At this point, you need to create a repository file for your MariaDB. To do this, you can use your desired text editor, here we use the vi editor:
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.
Then, use the following command to run the system update:
sudo dnf update -y
Step 2 – MariaDB Installation on Rocky Linux 9
At this point, you can use the following command to install your MariaDB 10.11:
sudo dnf install MariaDB-server -y
Step 3 – Start and Enable MariaDB Service
When your installation is completed, start and enable your service by using the command below:
sudo systemctl enable --now mariadb
Then, check your MariaDB service is active and running on Rocky Linux 9 with the following command:
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 ...
Step 4 – Secure MariaDB Installation
At this point, you can secure your MariaDB 10.11 installation on Rocky Linux 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!
Step 5 – Access MariaDB Shell
Now you can access your MariaDB shell on Rocky Linux 9 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.
Here are some MariaDB guides which you may be interested to use:
How To Upgrade MariaDB on AlmaLinux 9
Reset MySQL And MariaDB Root Password on Ubuntu 22.04
How To Upgrade MariaDB on Centos 7
At this point, you have learned to Install The current LTS version MariaDB 10.11 which is maintained for five years on Rocky Linux 9. It is a powerful and easy-to-use database management for creating and managing your databases.
Hope you enjoy it.