How to install MariaDB on CentOS 7

CentOS 7 Tutorial – Hello everyone, today I am going to update my tutorial on how to install and configure MariaDB on CentOS 7. I am installing this CentOS 7 server on a private cloud server at DigitalOcean. No matter you are installing CentOS on local server or cloud server, you may use the following steps to install MariaDB database server.

Steps to install MySQL (MariaDB) on CentOS 7 Server

Step 1. Install the MariaDB packages

Use this command to start installing MariaDB

yum install mariadb-server mariadb

Sample output:

Dependencies Resolved

=============================================================================================================
 Package                             Arch               Version                       Repository        Size
=============================================================================================================
Installing:
 mariadb                             x86_64             1:5.5.52-1.el7                base             8.7 M
 mariadb-server                      x86_64             1:5.5.52-1.el7                base              11 M
Installing for dependencies:
 perl-Compress-Raw-Bzip2             x86_64             2.061-3.el7                   base              32 k
 perl-Compress-Raw-Zlib              x86_64             1:2.061-4.el7                 base              57 k
 perl-DBD-MySQL                      x86_64             4.023-5.el7                   base             140 k
 perl-DBI                            x86_64             1.627-4.el7                   base             802 k
 perl-Data-Dumper                    x86_64             2.145-3.el7                   base              47 k
 perl-IO-Compress                    noarch             2.061-2.el7                   base             260 k
 perl-Net-Daemon                     noarch             0.48-5.el7                    base              51 k
 perl-PlRPC                          noarch             0.2020-14.el7                 base              36 k

Transaction Summary
=============================================================================================================
Install  2 Packages (+8 Dependent packages)

Total download size: 21 M
Installed size: 107 M
Is this ok [y/d/N]:

Answer y and press Enter to complete the installation.

Step 2. Start MySQL Server

systemctl start mariadb

Step 3. Secure MySQL Installation

mysql_secure_installation

Output:

Step 4. Enable MariaDB on server startup

systemctl enable mariadb

Now we have MariaDB database server up and running on CentOS 7 server. Thanks for reading this post and please share if you think this post is useful.

Admin

Leave a Reply

Your email address will not be published. Required fields are marked *