How Can We Help?

HOW TO INSTALL MARIADB 10.3 ON CENTOS 7

Table of Content

The MariaDB server is a MySQL server fork developed by the community. MariaDB is developed as a drop-in replacement for MySQL(r), with new features , new storage engines, fewer bugs and better performance by core members of the original MySQL team. For databases professionals who want a robust , scalable and reliable SQL server, MariaDB can be a better choice.

Add MariaDB Yum Repository

 [[email protected] ~]# vi /etc/yum.repos.d/mariadb.repo 

The above command will open a blank file . Please copy and paste the content given below:

[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled=1

Press the Esc button and exit with :wq

We need to import the public GPG key to verify the digital signatures of the packages in this repository before using the MariaDB andum repository.

However, the GPG public key does not need to be manually imported. When we first install a package from MariaDB yum repository, the public GPG key will be automatically installed by yum.

Here, for the sake of demonstration, we manually import the GPG public key.

 [[email protected] ~]# rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB 

We will move to the installation section. You can use the following command to install mariaDB.

 [[email protected] ~]# yum install -y mariadb-server 

Now, MariaDB has been installed successfully. We can start and enable the service of MariaDB.

 [[email protected] ~]#  systemctl start mariadb  
 [[email protected] ~]# systemctl enable mariadb 

We will move to the secure installation of MariaDB. The command is given below to initiate the process.

 [[email protected] ~]# mysql_secure_installation 

Press "enter" to set new password for MariaDB root, as shown in the above screenshot.

Now, You will get the prompt of the removal of anonymous User. You need to press "y" as per the image given below:

In the next prompt, you have to disable the root login of mariadb. You need to press "y" as per the image given below:

Now, the prompt would be shown for the removal of test databases. You need to press "y" as per the image given below:

In the last prompt, You will press "y" to reload the table privileges as shown in image below:

We have done with the configuration and secure installation portion of MariaDB.

We will use the below command for login into database:

 [[email protected] ~]# mysql -u root -p 

We have completed the section for installation and configuration of MariaDB.

Thank You 🙂

Table of Contents