How To Install/Upgrade MariaDB on CentOS, RHEL & Fedora

MariaDB is a drop-in replacement for MySQL. MariaDB is an opensource Relational Database Management System (RDBMS) which supports database access.

MariaDB is a logical choice for database professionals looking for a robust, scalable, and reliable SQL server.

Also read about MariaDB upgrade from 5.5, 10.0 to 10.1 & MariaDB 10.2 installation on Ubuntu, Debain & Mint Systems.

Suggested Read :
(#) How to Upgrade MariaDB 5.5 to MariaDB 10.0 & MariaDB 10.1 on Linux
(#) How To Install/Upgrade MariaDB on Ubuntu, Debian & Mint

MariaDB Features

  • More Storage Engines – The standard Storage Engines are MyISAM, BLACKHOLE, CSV, MEMORY, ARCHIVE, and MERGE. Additional Storage Engines are Aria, XtraDB, FederatedX, TokuDB, Cassandra, CONNECT, SEQUENCE, Spider also they are working on NoSQL storage engine too
  • Speed improvements – A lot of optimization done on MariaDB such as Disk access optimizations, Join optimizations, Subquery optimizations, Optimization for derived tables / views, Execution control, Optimizer control (optimizer switch) which will make MariaDB to improve the Speed overall compare with MySQL
  • Extensions & new features – They have added a lot of new features to MariaDB. If a patch or feature is useful, safe, and stable. The most notable features are Microseconds in MariaDB, Microsecond Precision in Processlist, Table Elimination, Virtual Columns, Extended User Statistics & Pluggable Authentication and for more details

Add 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, RHEL & Fedora systems.

First Create a file /etc/yum.repos.d/MariaDB.repo then copy and paste below code.

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

[For CentOS 6]
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/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 below code.

[For RHEL7 ppc4le]
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/rhel7-ppc64le
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

[For RHEL6 ppc4]
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/rhel6-ppc64
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 below code.

[For Fedora 25]
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/fedora25-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Install MariaDB

After adding MariaDB repository, just fire the below command to install MariaDB 10 on your systems.

[For RHEL/CentOS Systems]
# yum install MariaDB-server MariaDB-client

[For Fedora]
# dnf install MariaDB-server MariaDB-client

Start MariaDB Service

Use the below command to start MariaDB server for further usage.

[For SysVinit]
# service mysql start

[For systemd]
# systemctl start mysql.service

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.

# mysql_secure_installation

How to access MariaDB

Use the below command to access MariaDB service.

# mysql -u root -p

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.11-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

How to Upgrade MariaDB

Use the below command to Upgrade MariaDB service for new release

[For RHEL/CentOS Systems]
# yum upgrade MariaDB-server MariaDB-client

[For Fedora]
# dnf upgrade MariaDB-server MariaDB-client

Also read about phpMyAdmin Installation and configuration which will help you to manage the MariaDB database on Web without headache.

You may also like...