Install MariaDB 10.6 on CentOS 7

Install MariaDB 10.6 on CentOS 7

MariaDB is a commonly used OpenSource database mainly known for being robust and scalable with new storage engines. MariaDB is a development of MySQL which puts focus on stability and performance and makes it free to users. It is the default database in most Linux distributions. With a variety of tools and plugins, MariaDB is widely applicable.

Features of MariaDB 10.6

MariaDB 10.6 is the current stable version of MariaDB and comes with a number of new features as discussed below:

  • Ignored Indexes – These are indexes that are visible and maintained but not used by the optimizer
  • sys schema supported- This is a “system” database containing views and procedures for investigating performance problems.
  • SKIP LOCKED – Locked tables are skipped from being updated or selected.
  • JSON_TABLE() – can create a JSON table that can be used as a subquery from a JSON document.
  • OFFSET…FETCH…[WITH TIES] – WITH TIES is an optional clause that adds extra functionality. Example as used
  • Oracle compatibility – There are ongoing works in making MariaDB compatible with OracleDB with some Oracle Syntaxes and functions already added.

The Improvements in MariaDB 10.6 from MariaDB 10.5 include:

  • Atomic DDL – CREATE, ALTER, DROP and RENAME are atomic and crash-safe. If the MariaDB server crashes while processing any of these operations, the change will either e done completely or not done at all.
  • InnoDB improvements – First insert to an empty table is faster. Also writes to temporary tables are avoided. Faster implicit and explicit temporary tables.
  • Improvements in Galera. Ability to enable encrypted connections between two nodes without downtime. Also added flags to specify if Galera’s controversial compatible features should be enabled.
  • Clean up to remove unsupported features such as TukoDB Engine, Cassandra Engine, some InnoDB variables, and some innodb_checksum_algorithm.

Step 1: Update System Packages

Ensure that you are running the latest system packages before installation to avoid possible inconveniences with dependencies.

sudo dnf upgrade

Step 2: Add MariaDB Repository

We need to create a MariaDB repo file and add the content for the MariaDB installation

sudo vim /etc/yum.repos.d/MariaDB.repo

Paste the below content and save the file

 

# MariaDB 10.6 CentOS repository list - created 2021-08-04 11:35 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Step 3: Install MariaDB 10.6 on CentOS 7

Once you have saved the repo file, proceed to install MariaDB 10.6

sudo dnf install MariaDB-server MariaDB-client

Step 4: Start and Enable MariaDB

Once installed, start MariaDB and also enable it to start automatically on system reboot.

sudo systemctl start mariadb
sudo systemctl enable mariadb

Secure database server installation:

sudo mysql_secure_installation

Step 5: Check MariaDB Version

$ mysql -u root -p
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.6.3-MariaDB MariaDB Server

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

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

MariaDB [(none)]>

You can already see the installed MariaDB version from the output above. However, you can also run the below command to check the MariaDB version

MariaDB [(none)]> SELECT VERSION();
+-------------------------------------+
| VERSION()                           |
+-------------------------------------+
| 10.6.3-MariaDB |
+-------------------------------------+
1 row in set (0.000 sec)

MariaDB [(none)]>

 

Leave a Reply