Method of installing MariaDB on CentOS 7

We have a great experience working with MariaDB databases and have set it up for many of your customers in the past as part of our Server Management services.

We will show you how to setup and secure MariaDB on your CentOS machine.

It is important to add the MariaDB Yum repository file which hosts MariaDB packages. CentOS, RHEL and Fedora Distribution has a compatible version of the MariaDB.rep package.


To do this, use the command below:


vi /etc/yum.repos.d/MariaDB.repo


As soon as the MariaDB.repo is open, you can add the following attributes to it;


On CentOS 7
name = MariaDB
baseurl =


Installing MariaDB

Next, As soon as the above process is completed, you can proceed with using the following MariaDB command to install it;


yum install MariaDB-server MariaDB-client -y


Starting the MariaDB service

After the installation is successful, you can start the MariaDB server daemon  and make it auto start whenever the system is booted via the command below;


systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb



Securing MariaDB on CentOS

As soon as MariaDB service is started, it is great to secure it by giving it a strong password by disabling remote root access login, taking off the default test database with the anonymous users and resetting the privileges. This can be achieved via the command below;



Confirming MariaDB service and Version

Finally, you can confirm the status of the MariaDB service as well as the version via the command below;

mysql -V
mysqld --print-defaults
mysql -u root -p



Basically, you can see that setting up MariaDB on CentOS is easy and MariaDB  is a great Database system. Our Linux Server Experts can manage your Server and set up MariaDB on your machine. For professional Support, contact us.

MariaDB is a very popular Database management system which is open source. It is well know as being stable and in this context , we will analyze how to get it running on your CentOS 7 Linux machine.

Related Posts