How to Install MariaDB Server on Red Hat Enterprise Linux 9

How to Install MariaDB Server on Red Hat Enterprise Linux 9

MariaDB is a free and open-source relational database management system. It was released in 2009 by MariaDB Foundation. It is cross-platform and can be installed on Linux, Windows, and macOS. It comes default in some of the Linux distributions.

MariaDB is a drop-in replacement for MySQL database. It is a fork of the MySQL project and it was forked in 2011 by a group of developers who wanted to focus on enterprise features rather than website features. MariaDB uses the same technology as MySQL but has many advanced features which are not found in MySQL.

There are two types of storage engines in MariaDB: MyISAM and InnoDB. The default engine is MyISAM. MariaDB has built-in data integrity and it provides full ACID transaction support. You can use a Master-Slave configuration that automatically replicates data from the master server to the slave servers.

In this guide, we are going to show you the steps to install MariaDB server on Red Hat Enterprise Linux 9.

Prerequisite

  • RHEL 9 instance
  • Root login or a user with sudo privileges

Install MariaDB on Red Hat Enterprise Linux 9

Install MariaDB

To get started with installation, run the following command on the terminal.

sudo yum install mariadb-server

Start MariaDB service

Once the MariaDB server is installed, you can start its service in a following manner.

sudo systemctl start mariadb.service

Enable MariaDB to start at boot

This is an optional step which enables MariaDB to start at boot time of system. You would run:

sudo systemctl enable mariadb.service

Check Status of MariaDB on Red Hat Enterprise Linux 9

Let’s verify the status of MariaDB server in the following fashion. You would run:

sudo systemctl status mariadb.service

The output shows that MariaDB server is up and running. Congrats!!

Connect to MariaDB shell

You can connect to MariaDB shell by executing the command on the terminal:

sudo mariadb

Currently, the password is empty which you can set after entering the shell.

Conclusion

You can install MariaDB on your server with just a single command ‘sudo yum install mariadb-server’. You can start the service with ‘sudo yum start mariadb.service’ command.

Please also check our article ‘how to install MySQL on Red Hat Enterprise Linux 9’.