π Introduction
MariaDB 10.11 is not available in the default repositories of Rocky Linux 9. This guide will provide you with the steps to install MariaDB 10.11 using a stable, external repository.
π οΈ Adding the MariaDB Repository
Create and edit the repository file:
sudo vim /etc/yum.repos.d/MariaDB.repo
Add the following configuration (retrieve the repo config fromΒ MariaDB’s official site):
# MariaDB 10.11 RedHatEnterpriseLinux repository list - created 2024-04-19 09:28 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
# rpm.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
# baseurl = https://rpm.mariadb.org/10.11/rhel/$releasever/$basearch
baseurl = https://mirror.djvg.sg/mariadb/yum/10.11/rhel/$releasever/$basearch
# gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgkey = https://mirror.djvg.sg/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
π§ Installing MariaDB
Now you can install MariaDB 10.11:
sudo dnf install MariaDB-server MariaDB-client
βοΈ Managing MariaDB Service
After installation, start and enable the MariaDB service:
sudo systemctl enable --now mariadb
To manage the MariaDB service, use the following commands:
- Start:
sudo systemctl start mariadb
- Stop:
sudo systemctl stop mariadb
- Restart:
sudo systemctl restart mariadb
- Status:
sudo systemctl status mariadb
π Final Steps
After MariaDB is running, it’s recommended to secure your installation:
sudo mariadb-secure-installation
Follow the prompts to set a root password and secure your installation.
πΒ Checking the Installation
Verify that MariaDB is installed correctly by logging into the MariaDB console:
mysql -u root -p
status
π Congratulations! You’ve successfully installed MariaDB 10.11 on Rocky Linux 9. You can now begin using MariaDB for your database needs.