MariaDB is a free and open-source database management system. MariaDB is a multi-user, multi-threaded SQL database server forked from the MySQL relational database management system. MariaDB is the recommended distribution if you are curious about MySQL vs. MariaDB. It should also function smoothly in the replacement of MySQL.
In this article, we will explain to you how to install MariaDB on Centos/RHEL 8
Step 1: Update your CentOS/RHEL 8 System
First, update your CentOS or RHEL system using the mentioned command.
# dnf update
MariaDB package is available in Appstream repository and can be installed by running the command:
# dnf install mariadb-server
You can check the version of MariaDB by running the below command.
# rpm -qi mariadb-server
Step 2: Start the MariaDB Service
Now start the MariaDB service and enable it to start on boot using the below commands.
# systemctl enable mariadb
# systemctl start mariadb
Step 3: Set Root Password
Apply security on MariaDB and also set root user password using mention command.
Step 4: Create Sample Database (Optional)
Now, we will try to create a sample database using below mentioned commands:
# mysql -u root -p
MariaDB [(none)]> CREATE DATABASE Techworld;
MariaDB [(none)]> GRANT ALL ON Techworld.* TO 'TechUser'@'localhost' IDENTIFIED BY 'Redhat123???';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;