How to Install & Upgrade MariaDB 10.1.12 on Centos, RHEL & Fedora

MariaDB is a drop-in alternative for MySQL. MariaDB is an opensource Relational Database Management System (RDBMS) which supports database access.It is easy to set up, provides many speed and efficiency developments, and is not hard to integrate into most MySQL deployments. MariaDB provides more storage engines than MySQL, such as Cassandra (NoSQL, in MariaDB Edition 10), XtraDB (drop-in alternative for InnoDB), and OQGRAPH (in MariaDB Edition 10).

Prerequisities

  1. These guidelines are intended for installing MariaDB on CentOS, RHEL & Fedora
  2. SSH client like Putty and proper knowledge to use it.
  3. Some basic knowledge about common Linux commands.
  4. 20 minutes of your time with a cup of tea or coffee as always.

Step 1 – Add MariaDB YUM Repositories

By default MariaDB 5.x Series included all the Linux distributions and removed MySQL but they didn’t include MariaDB 10.x series. Use the below instructions to add MariaDB Repositories on CentOS, RHEL & Fedora systems.

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

For CentOS 7 Systems 

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

For CentOS 6 Systems

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

For RHEL Systems : First Create file /etc/yum.repos.d/MariaDB.repo then Copy and paste it.

For RHEL 7 Systems

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

For RHEL 6 Systems

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

For Fedora Systems : First Create file /etc/yum.repos.d/MariaDB.repo then Copy and paste it.

For Fedora 23 Systems

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

For Fedora 22 Systems

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

Step 2- Install MariaDB

Once you have added MariaDB repository, just run the below command to install MariaDB 10 on your systems.

For RHEL/CentOS/Fedora 21 & older Systems

yum install MariaDB-server MariaDB-client

For RHEL/CentOS/Fedora 22 & later Systems

dnf install MariaDB-server MariaDB-client

Step 3- Start MariaDB Service

After the installation completes,Use the below command to start MariaDB service for further usage.

For SysVinit Systems
service mysql start

For systemd Systems 
systemctl start mysql.service

Make sure that MySQL/MariaDB starts at boot:

systemctl enable mariadb

Step 4- How to Secure MariaDB

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

mysql_secure_installation

Step 5- How to access MariaDB

You can use the below command to access MariaDB service.

mysql -u root -p

Step 6- View Existing Databases

Run the following command to view default databases that comes with installation.

show databases;

Type quit from command prompt to exit from shell.

quit

Step 7- How to Upgrade MariaDB

Use the below command to Upgrade MariaDB service for new release

For RHEL/CentOS/Fedora 21 & older Systems
yum upgrade MariaDB-server MariaDB-client

For RHEL/CentOS/Fedora 22 & later Systems 
dnf upgrade MariaDB-server MariaDB-client

So this is all you have to do, Also read about phpMyAdmin Installation and configuration which will help you to manage the MariaDB database on Web. Please Give your opinion below if you experience any issues or to discuss your ideas and experiences.

Leave a Reply

Register to Get FREE Offers

Why Pay for Software when you can GET it for FREE

JOIN US TONIGHT!