HomeDATABASEInstall MariaDB Database on Rocky Linux 9|AlmaLinux 9

Install MariaDB Database on Rocky Linux 9|AlmaLinux 9

In our today’s guide, we will take you through how to Install MariaDB Database on Rocky Linux 9|AlmaLinux 9. Relational database MariaDB is a free and open-source derivative of the MySQL platform. After the Oracle Corporation intended to release an enterprise version of MySQL in 2010, it was created by the original MySQL database developers. The MariaDB Foundation welcomes contributions based on technical merit, and MariaDB’s performance, reliability, and openness are well-known. The most recent upgrades include capabilities that work with Oracle Database compatibility and powerful clustering with Galera Cluster 4.

Features of MariaDB Database

MariaDB Database has the following cool features:

  • Numerous programming languages and different operating systems are supported by MariaDB.
  • MariaDB supports PHP, one of the most widely used web development languages.
  • MariaDB makes Galera cluster technology available.
  • In addition, MariaDB has a variety of commands and procedures that aren’t available in MySQL, as well as performance-harming capabilities.
  • Under the terms of the GPL, LGPL, or BSD licenses, MariaDB is offered.
  • MariaDB offers a selection of storage engines, including high-performance storage engines, for working with various RDBMS data sources.
  • The querying language used by MariaDB is well-known and often used.

Install MariaDB Database on Rocky Linux 9|AlmaLinux 9

The following steps will take you through how to install MariaDB Database on Rocky Linux 9|AlmaLinux 9. Let’s dive in.

Step 1~ Update Rocky Linux 9|AlmaLinux 9

Run the following command to update Rocky Linux 9|AlmaLinux 9 system:

sudo dnf update
sudo reboot

Step 2~ Install MariaDB on Rocky Linux 9|AlmaLinux 9

By running the following command, MariaDB version 10.5 will be installed:

sudo dnf install mariadb-server mariadb

Accept the installation prompt:

Dependencies resolved.
====================================================================================================================================================================================================================
 Package                                                       Architecture                              Version                                                 Repository                                    Size
====================================================================================================================================================================================================================
Installing:
 mariadb                                                       x86_64                                    3:10.5.16-2.el9_0                                       appstream                                    1.6 M
 mariadb-server                                                x86_64                                    3:10.5.16-2.el9_0                                       appstream                                    9.4 M
Installing dependencies:
 mariadb-common                                                x86_64                                    3:10.5.16-2.el9_0                                       appstream                                     31 k
 mariadb-connector-c                                           x86_64                                    3.2.6-1.el9_0                                           appstream                                    195 k
 mariadb-connector-c-config                                    noarch                                    3.2.6-1.el9_0                                           appstream                                    9.8 k
 mariadb-errmsg                                                x86_64                                    3:10.5.16-2.el9_0                                       appstream                                    215 k
 mysql-selinux                                                 noarch                                    1.0.5-1.el9_0                                           appstream                                     35 k
 perl-DBD-MariaDB                                              x86_64                                    1.21-16.el9_0                                           appstream                                    151 k
 perl-File-Copy                                                noarch                                    2.34-479.el9                                            appstream                                     29 k
 perl-Sys-Hostname                                             x86_64                                    1.23-479.el9                                            appstream                                     26 k
Installing weak dependencies:
 mariadb-backup                                                x86_64                                    3:10.5.16-2.el9_0                                       appstream                                    6.4 M
 mariadb-gssapi-server                                         x86_64                                    3:10.5.16-2.el9_0                                       appstream                                     19 k
 mariadb-server-utils                                          x86_64                                    3:10.5.16-2.el9_0                                       appstream                                    213 k

Transaction Summary
====================================================================================================================================================================================================================
Install  13 Packages

Total download size: 18 M
Installed size: 108 M
Is this ok [y/N]: y

Check the version of MariaDB Installed:

$ mysql --version
mysql  Ver 15.1 Distrib 10.5.16-MariaDB, for Linux (x86_64) using  EditLine wrapper

As per the output above, the version installed is 10.5.

Now, Start and enable the MariaDB Database service:

sudo systemctl enable --now mariadb

Confirm if MariaDB Database is active and running:

$ systemctl status mariadb
 mariadb.service - MariaDB 10.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2022-09-06 16:39:34 CEST; 9s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 75941 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
Process: 75963 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 76109 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
Main PID: 76085 (mariadbd)
Status: "Taking your SQL requests now…"
Tasks: 18 (limit: 28441)
Memory: 75.6M
CPU: 463ms
CGroup: /system.slice/mariadb.service
└─76085 /usr/libexec/mariadbd --basedir=/usr

Step 3~ Secure MariaDB Database Server

Once the MariaDB Database server is installed successfully, secure the installation by setting a password for the root user:

$ sudo mysql_secure_installation
......
Enter current password for root (enter for none): <ENTER>
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] y

Change the root password? [Y/n] y
New password: <NEW-PASSWORD>
Re-enter new password: <RE-ENTER PASSWORD>
Password updated successfully!

Remove anonymous users? [Y/n] y

Disallow root login remotely? [Y/n] y

Remove test database and access to it? [Y/n] y

Reload privilege tables now? [Y/n] y

Thanks for using MariaDB!

Log in to the database using the root password created above:

$ mysql -u root -p
Enter password: <ENTER PASSWORD>
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.16-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)]>

Finale

This concludes our tutorial on how to Install MariaDB Database on Rocky Linux 9|AlmaLinux 9. Now is the time to begin building your databases. Use MariaDB Database Server with pleasure.

Read more about MariaDB.

Other Guides;

- Advertisment -

Recent posts

2 COMMENTS

  1. I don’t know if it’s just me or if perhaps everybody else
    encountering issues with your site. It appears like some of the written text on your content are running off the
    screen. Can somebody else please provide feedback and let me know if this is happening to them too?
    This could be a problem with my browser because
    I’ve had this happen before. Cheers

LEAVE A REPLY

Please enter your comment!
Please enter your name here