MariaDB is a fork of MySQL, which has been around for over 20 years and has some features that stay true to the original vision. With RHEL 8.5 now being released as an LTS release we want you to be familiar with how MariaDB installs on your system, where it will live during its lifecycle before upgrading, what options exist when updating later in life and how to secure it after installation.
MariaDB is a well-known open-source relational database management system that provides useful database solutions to a wide range of customers throughout the operating system ecosystem.
It has a community-developed status since it is a MySQL fork. The latter statement suggests that MariaDB has a growing community of users who can help those who are new to the database software or who want to learn more about it.
On the RHEL 8 system you’re running, make sure you have sudo/root user capabilities.
MariaDB installation on RHEL Linux
Always make sure your Linux system is up to date before installing or configuring any software package, as a Linux operating system rule of thumb.
$ sudo yum update && sudo yum upgrade -y
Next, on your RHEL 8 workstation, install the MariaDB database server.
yum install mariadb-server $ sudo yum install mariadb-server
Respond to the [y/n] prompt to confirm that you wish to install the MariaDB database server, which will then start the installation on your RHEL system.
In RHEL Linux, install MariaDB.
After the installation is complete, you may use your terminal to start, enable, and check the status of MariaDB. Enabling this RDBMS guarantees that it continues to run even after the system has been successfully rebooted.
$ sudo systemctl start mariadb $ sudo systemctl enable mariadb $ sudo systemctl status mariadb Check MariaDB Status in RHEL
Run the following command to see what MariaDB version is installed:
$ mysql –version Check MariaDB Version in RHEL
MariaDB security in RHEL Linux
Following the successful installation of MariaDB, we must execute the following security script to safeguard the installation.
mysql secure installation $ sudo mysql secure installation
The following command will assist you with configuring essential actions such as removing anonymous users, disallowing root login remotely, removing test the database, and reloading privilege tables, which are all preset to blank.
MariaDB security in RHEL Linux
The next step is to use the root user password you generated to get into your MariaDB database.
$ mysql -u root -p Connect MariaDB Shell
You may create a database user to whom you can give database responsibilities from here:
MariaDB [(none)]> CREATE USER [email protected] IDENTIFIED BY “Your_preferred_db_user_password”;
We can also create a fictitious database and show how this person can manipulate it.
MariaDB [(none)]> CREATE DATABASE linuxshelltips_db;
We’ll run the following command to give the newly formed database user complete power over the database and all of its related database tables:
MariaDB [(none)]> GRANT ALL ON linuxshelltips_db.* TO [email protected];
Exit the MariaDB console after flushing privileges.
MariaDB [(none)]> FLUSH PRIVILEGES: MariaDB [(none)]> exit Create Database User Roles
This article showed how to set up the MariaDB database server, setup root database user credentials, create a random database user, and give that user power over a database that was generated at random.
Frequently Asked Questions
How do I start MariaDB in RHEL 8?
A: To install MariaDB in a RHEL 8 system, first use yum to search for the packages that are needed. Then run these commands as root user::
yum install mariadb-server -y
systemctl start mariadb
How do I set up and install MariaDB?
A: MariaDB is not installed by default when you install the operating system. You need to download and run a package installer which will help you set up MariaDB on your server.
What is the default password for MariaDB?
A: This is a database management system that you can use on Ubuntu Linux. The default password is root with no quotes, so this would be the password to log into your MariaDB server if there was one that needed logging in using SSH, for example.