How To Install MariaDB on CentOS/RHEL 8
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.
Useful Articles:
- INSTALL MARIADB 10.0 ON CENTOS/RHEL 7/6/5
- HOW TO INSTALL MARIADB 10.0 ON UBUNTU SERVER
- HOW TO INSTALL IREDMAIL MAIL SERVER ON CENTOS/RHEL 7/6
- HOW TO INSTALL MYSQL 5.7 ON CENTOS/RHEL 8
- INSTALL AND CONFIGURE AMBARI SERVER WITH MYSQL IN CENTOS/RHEL 7/6
- INSTALL MYSQL PASSWORD VALIDATION PLUGIN ON LINUX
- HOW TO CHANGE MYSQL PASSWORD POLICY LEVEL ON LINUX
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.
# mysql_secure_installation
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;
Enjoy it!