Database Linux Tutorials

Install MariaDB latest stable ( 10.1.17 ) CentOS 7 / RHEL 7


1) Adding MariaDB Repositories

By default MariaDB 5.x Series was included all the Linux distribution and removed MySQL but they didn’t include MariaDB 10.x series and if you want Add MariaDB Repositories, use the below commands to add MariaDB Repositories on CentOS 7, RHEL 7 systems.

First Create file /etc/yum.repos.d/mariadb.repo then Copy and paste it.

vim /etc/yum.repos.d/mariadb.repo

Screen Shot 2016-10-10 at 7.57.25 PM

name = MariaDB
baseurl =

Screen Shot 2016-10-10 at 7.58.06 PM

2) Install MariaDB

run the following code

yum update

yum install MariaDB-server MariaDB-client

Screen Shot 2016-10-10 at 7.58.24 PM

Screen Shot 2016-10-10 at 7.59.19 PM

Screen Shot 2016-10-10 at 7.59.29 PM

Screen Shot 2016-10-10 at 7.59.46 PM

Screen Shot 2016-10-10 at 8.00.09 PM

3) Start MariaDB Service

Use the below command to start MariaDB server for further usage, and enable it in startup.

systemctl start mariadb
systemctl enable mariadb
systemctl is-enabled mariadb

Screen Shot 2016-10-10 at 8.05.20 PM

4) Secure MariaDB

By default MariaDB wont have root password and it’s security issue. So, run the below command to secure MariaDB installation, This will set root password for MariaDB also set other permission and remove test databases too.


Screen Shot 2016-10-10 at 8.05.51 PM

and look over the following images.


guess_linux_mariadb2 guess_linux_mariadb3 guess_linux_mariadb4


5) Testing

mysql -u root -p

give your root password.

guess_linux_mariadb6 guess_linux_mariadb7 guess_linux_mariadb8

Thank you.


Leave a Comment