Tutorial : How to install MariaDB 10.4 on CentOS 7 in your vps

In this tutorial we are going to give quick and short tutorial about installing MariaDB on CentOS 7 in your VPS. This has been tested running well on CentOS 7

 

Overview

MariaDB 10.4 is the current major stable version. The first stable release was in June 2019, and it will be supported until June 2024.

Okay, first thing first.
Step one : update your OS

yum -y update

 

Step 2 : Add MariaDB 10.4 repository. Create a new repo file /etc/yum.repos.d/mariadb.repo. The latest repos for all linux distros are located at here:https://downloads.mariadb.org/mariadb/repositories


tee /etc/yum.repos.d/MariaDB.repo<<EOF

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.4/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

EOF

 

Step 3 : Install MariaDB Server

Now you are ready to install MariaDB Server

 


yum -y install MariaDB-server MariaDB-client

 

Step 4 : Start MariaDB service

Once it is completed, you can start MariaDB Services


systemctl start mariadb

 

Step 5 :Enable MariaDb service at system boot up


systemctl enable mariadb

 

Step 6. You need to Secure MariaDB Install

 


mysql_secure_installation

The question may encounter as below


=====================================================================

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

 

Enter current password for root (enter for none):

OK, successfully used password, moving on…

 

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

… Success!

 

Remove anonymous users? [Y/n] y

… Success!

 

Disallow root login remotely? [Y/n] y

… Success!

 

Remove test database and access to it? [Y/n] y

– Dropping test database…

… Success!

– Removing privileges on test database…

… Success!

 

Reload privilege tables now? [Y/n] y

… Success!

 

Cleaning up…

Thanks for using MariaDB!

=====================================================================

 

That’s all our quick and short tutorial to day, hopefully it is useful for you and your work.