MariaDb is a free and open source database management software like MySQL. It has been developed by the team who developed the legendary MySQL.
In this tutorial, we will show you how you can install MariaDB on the wide range of environments like RHEL/CentOS and Fedora distributions.
To Install MariaDB follow this step as follows;-
NOTE: All the commands as been run as a root user.
Step #1 – Add MariaDB yum Repository
Add the MariaDB yum repository to MariabDB.repo on your RHEL/CentOS and Fedora distributions
# vi /etc/yum.repos.d/MariaDB.repo
Now add the following lines on the MariaDB.repo file.
For CentOS 7
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
For RHEL 7
[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/rhel7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
After adding the above lines on, your system, save the file on your system.
Step #2: Installing MariaDB on CentOS 7
Once adding the yum repository, you can easily install MariaDB in one command
# yum install MariaDB-server MariaDB-client -y
After that, a text will appear with the total size of MariaDB and Is this ok [y/d/n]. press y to install the MariaDB packages.
Once the package installation completes then star your MariaDB server using the following command
# systemctl start mariadb
systemctl enable mariadb this command means that it will enable MariaDB to start automatically at the next boot
Step #3: Securing MariaDB
initiate the mysql_secure_installation in order to set the root password and disable the remote login and many more..
After securing the MariaDB server login into your MariaDB server in order to check if its working or not
# mysql -h localhost -u root -p // login command
Sample Information /* Show Databases*/ mysql> show databases; /* CREATE NEW DATABASE */ mysql> CREATE DATABASE vedant;
In order to check the MariaDB version use the following command:-
# mysql -V