Databases 50 min read

Step-by-Step Guide to Installing and Understanding MariaDB

This comprehensive tutorial introduces MariaDB, explains its origins and key features, and provides detailed, cross‑platform installation and configuration instructions for Rocky Linux, Ubuntu, openSUSE and other distributions, including network setup, repository configuration, package installation, service management, and security hardening.

Raymond Ops
Raymond Ops
Raymond Ops
Step-by-Step Guide to Installing and Understanding MariaDB

MariaDB Overview

MariaDB is an open‑source relational database management system (RDBMS) created in 2009 by the original MySQL developers as a community‑driven replacement for MySQL. It maintains full compatibility with MySQL file formats, APIs, SQL syntax and a command‑line client while adding innovative features and an open ecosystem.

Origin and Background

After MySQL was acquired by Sun and later Oracle, concerns about commercialisation led Michael Widenius and other core developers to fork the project and launch MariaDB, named after Widenius' daughter. Today it is one of the most popular MySQL alternatives worldwide.

Key Features

High compatibility with MySQL – identical data file format, API, SQL syntax and the mysql client, allowing seamless migration.

Optimised storage engines – XtraDB (default InnoDB replacement), Aria, ColumnStore, Connect, each offering specific performance or integration benefits.

Enterprise‑grade enhancements – Galera Cluster for multi‑master replication, multi‑threaded replication, GIS support, dynamic columns, transparent data encryption, fine‑grained privileges and audit logging.

Performance optimisations – improved query optimiser, hash and full‑text indexes, memory‑table encryption/compression and better OLTP handling.

Security features – TLS/SSL, role‑based access control, column‑level permissions and optional SELinux/AppArmor integration.

Community and Ecosystem

The project is governed by the MariaDB Foundation, ensuring open governance and transparent decision‑making. Commercial support is provided by MariaDB Corporation. MariaDB integrates with popular DevOps tools (Docker, Kubernetes), cloud platforms (AWS, Azure, Alibaba Cloud) and big‑data frameworks (Hadoop, Spark).

Typical Use Cases

Traditional enterprise applications (ERP, CRM) requiring high availability and transactional consistency.

High‑traffic web services and e‑commerce platforms.

Big‑data analytics using the ColumnStore engine.

Cloud‑native deployments via containers or managed services such as RDS for MariaDB.

Installation Guide

The guide covers host preparation, network interface renaming, GRUB and udev adjustments, firewall and SELinux/AppArmor disabling, timezone configuration, and IP address setup for a variety of Linux distributions (Rocky Linux, AlmaLinux, CentOS, openEuler, AnolisOS, OpenCloudOS, Ubuntu, Debian, openSUSE).

Network Interface Configuration

For RHEL‑compatible systems create /etc/systemd/network/70-eth0.link with the desired MAC address, or rename the existing interface using ip link and sed. For NetworkManager‑managed hosts rename the connection file under /etc/NetworkManager/system-connections.

GRUB and Udev Adjustments

On older releases edit /etc/default/grub to add net.ifnames=0 biosdevname=0 and rebuild the GRUB configuration. On systems that require a persistent name, add a rule to /etc/udev/rules.d/10-network.rules with the MAC address and the target name eth0.

IP Address and DNS Configuration

Configure static IPv4 settings using the appropriate network manager: /etc/sysconfig/network-scripts/ifcfg-eth0 for RHEL families, /etc/netplan/*.yaml for Ubuntu, or /etc/network/interfaces for Debian. Set the desired IP, prefix, gateway and DNS servers.

Repository Mirrors

Replace the default distribution mirrors with faster mirrors (e.g., Alibaba Cloud, TUNA) by editing the repository files ( /etc/yum.repos.d/*.repo, /etc/apt/sources.list.d/*.list, /etc/zypp/repos.d/*.repo) and running the package manager cache refresh command.

Package Installation

Install MariaDB from the distribution’s default repository:

# yum -y install mariadb-server   # RHEL/CentOS/Rocky
# apt -y install mariadb-server   # Ubuntu/Debian
# zypper install -y mariadb       # openSUSE

Enable and start the service:

# systemctl enable --now mariadb

Verify the installation with mariadb -V and mariadb client commands.

Official MariaDB Repository (Optional)

For newer versions, add the official MariaDB repository. Example for RHEL 9:

# cat > /etc/yum.repos.d/MariaDB.repo <<EOF
[mariadb]
name = MariaDB
baseurl = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/11.8/rhel/$releasever/$basearch
gpgkey = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
EOF
# dnf install -y MariaDB-server

Similar .list files can be created for Ubuntu/Debian using the TUNA mirror.

Security Hardening

Run mariadb-secure-installation to:

Switch to unix_socket authentication for the root account.

Remove anonymous users.

Disallow remote root login.

Delete the default test database.

Reload privilege tables.

Conclusion

MariaDB combines MySQL compatibility with a rich set of extensions, making it a versatile choice for traditional enterprise workloads, high‑traffic web applications, analytics, and cloud‑native environments. The provided installation and hardening steps enable a secure, production‑ready deployment on a wide range of Linux distributions.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

databaseConfigurationLinuxInstallationMariaDB
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.