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:
- 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
- Install MariaDB by running the following command:
sudo dnf install mariadb-server
- Once the installation is complete, start the MariaDB service:
sudo systemctl start mariadb
- To make sure MariaDB starts automatically at boot time, run the following command:
sudo systemctl enable mariadb
- 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.
- Once the script is finished, you can log in to the MariaDB shell using the following command:
mysql -u root -p
- 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.