Home » DB Install » How to Install MariaDB on Red Hat Enterprise Linux 6 Operating System

How to Install MariaDB on Red Hat Enterprise Linux 6 Operating System

MariaDB is the latest open source and popular relational database management system, compatible and replacement of MySQL.
MariaDB developed with MySQL original developers and many people from the community.
 
The Red Hat Enterprise Linux (RHEL) 6 Operating System release was replaced MySQL with MariaDB as the default database system.

In this tutorial article, we will show how to install MariaDB into CentOS, but for any reason you want to install MySQL into your CentOS, you can check the How to install MySQL on RHEL 6 tutorial.

If your required application does not have any specific database requirements, you should go with MariaDB, default database of RHEL 6 Operating System.

Prerequisites

Before starting the process of installing MariaDB, make sure you have a RHEL 6 running system and a user to login into the system with sudo privileges.

Install MariaDB on RHEL 6

The default RHEL 6 repository providing MariaDB version 5.5, it is not the latest version of MariaDB, but it is a stable release.

To install MariaDB into RHEL 6, you need to follow the below process:

Step 1 – Install MariaDB

To install MariaDB 5.5 version into RHEL 6 by using the following Command:

$ sudo yum install mariadb-server
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
Step 2 – Start MariaDB Service
 
After installation of MariaDB, the service automatically started, but you can use below command for manually start the MariaDB service:
$ sudo systemctl start mariadb
Step 3 – Enable MariaDB Service
 
You should enable the MariaDB service to make MariaDB service auto start on system startup, by using the following command:
$ sudo systemctl enable mariadb
Step 4 – Verify MariaDB
 
To verify the MariaDB service, you can check the status of the service by using the following command:
$ sudo systemctl status mariadb
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
Step 5 – MariaDB Secure Installation
 
To secure the MariaDB installation like change root password, restrict root access to localhost, remove test database, etc. to perform this task, you should run this command:
$ sudo mysql_secure_installation
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
  • Facebook
  • Twitter
  • reddit
  • LinkedIn

Install Latest MariaDB on RHEL 6

The latest MariaDB server version 10.3 is not coming with default repository of RHEL 6. If you want to install the latest version of MariaDB into RHEL 6 system, create MariaDB repository file to install the latest MariaDB directly from official repository of MariaDB packages.

Let’s start the installation process of MariaDB 10.3 into RHEL 6 by the following procedure:

Step 1 – Enable MariaDB Repository
 
To enable MariaDB repository into a CentOS system, you need to create a repository file into /etc/yum.repos.d/ directory, as you can see below, we have created MariaDB repository file with the name of MariaDB.repo, you should also create the same file into your system.
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
Step 2 – Install MariaDB Server and Client
 
After creating the repository file, you should update your system’s repository package list by using the following command:
$ sudo yum update
  • Facebook
  • Twitter
  • reddit
  • LinkedIn

Once the CentOS package is updated, you can use the following command to install mariaDB Server and Client:

$ sudo yum install MariaDB-server MariaDB-client

You may get below the screen to import MariaDB GPG key into the system:

  • Facebook
  • Twitter
  • reddit
  • LinkedIn

You should type Y (yes) to allow to download the key file.

Step 3 – Enable and start the MariaDB Service
 
Once the installation of MariaDB completed, you should enable and start the service, as shown below:
$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb
Step 4 – Verify MariaDB installation
 
You can verify the MariaDB installation by checking the status of service using the following command:
$ sudo systemctl status mariadb
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
Step 5 – MariaDB Secure Installation
 
After installation and running service need to make your MariaDB secure, and to perform the security operation need to execute mysql_secure_instalaltion script, as shown below:
$ sudo mysql_secure_installation
This script will use to set the password for root, restrict root user to localhost, remove anonymous users, and remove test database, etc.
 
All step will appear on the screen with detailed, and you need to press Y as your answer to accept the security changes.
  • Facebook
  • Twitter
  • reddit
  • LinkedIn
  • Facebook
  • Twitter
  • reddit
  • LinkedIn

MariaDB connection from CLI

To connect MariaDB server using terminal or CLI with root user credential type the below command:
$ mysql –u root –p
Now it will ask you to enter a password for the root user and press enter.
 
Once you logged in into MariaDB shell and you will get a screen like below:
  • Facebook
  • Twitter
  • reddit
  • LinkedIn

Conclusion

In this acritical, we learned how to install MariaDB into RHEL 6 system. We also learned to install MariaDB directly from MariaDB repository.

Now MariaDB is installed in your system successful, and you know how to connect with MariaDB shell to perform Database commands and operations.

Related Posts

How to Install MongoDB on RHEL 8 Linux

How to Install MongoDB on RHEL 8 Linux

MongoDB is an open-source and free NoSQL document based database system. Nowadays, it is prevalent as most application developers are using MongoDB, which can handle big data. As a MongoDB is a NoSQL database, It stores data in JSON-like documents where fields can...

How to Install Python 3 on RHEL 8 (Red Hat Enterprise Linux)

How to Install Python 3 on RHEL 8 (Red Hat Enterprise Linux)

Python is one of the most popular and easy to code programming language nowadays, because of its simplicity and easy to code. It is now very popular among beginners and experienced computer programmers or developers. It is use to develop any kinds of...

How to Install MongoDB on RHEL 7 Linux

How to Install MongoDB on RHEL 7 Linux

MongoDB is an open-source and free NoSQL document based database system. Nowadays, it is prevalent as most application developers are using MongoDB, which can handle big data. As a MongoDB is a NoSQL database, It stores data in JSON-like documents where fields can...

How to Install OpenCV on RHEL 8 (Red Hat Enterprise Linux)

How to Install OpenCV on RHEL 8 (Red Hat Enterprise Linux)

OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in commercial...

Follow Us

Our Communities

More on Redhat

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!

0 Comments

0 Comments

Submit a Comment

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

eight − five =

Shares