How To Install MariaDB on RHEL 8

Installing MariaDB on Red Hat Enterprise Linux 8 (RHEL 8) is a fairly straightforward process. Here’s an overview of the steps you’ll need to take:

  1. Start by adding the MariaDB repository to your system. You can do this by running the following command:
sudo dnf config-manager --add-repo https://downloads.mariadb.com/MariaDB/mariadb_repo.cfg
  1. Install MariaDB by running the following command:
sudo dnf install mariadb-server
  1. Once the installation is complete, start the MariaDB service:
sudo systemctl start mariadb
  1. To make sure MariaDB starts automatically at boot time, run the following command:
sudo systemctl enable mariadb
  1. Next, run the mysql_secure_installation script to secure your MariaDB installation:
sudo mysql_secure_installation

This script will prompt you to set a root password, remove anonymous users, disallow root login remotely, and remove the test database.

  1. Once the script is finished, you can log in to the MariaDB shell using the following command:
mysql -u root -p
  1. You can check the version of mariadb by running the following command
mysql -V

By following these steps, you should now have a working installation of MariaDB on your RHEL 8 system. You can now use the MariaDB shell to create and manage databases and users.

Leave a Comment