MariaDB Administration

MariaDB is a community-developed fork of MySQL created in 2009 when Oracle acquired MySQL. It maintains wire-protocol compatibility with MySQL (the same client tools work, the same SQL syntax works) but adds its own features and performance improvements. Ubuntu includes MariaDB in its default repositories and many Linux deployments prefer it over MySQL. For most web application use cases, MariaDB and MySQL are interchangeable.

MariaDB vs MySQL

AspectMariaDBMySQL
LicenseGPL only (truly open source)Dual: GPL + commercial Oracle
Default storage engineInnoDB (same)InnoDB
JSON supportVirtual columns approachNative JSON type
Thread poolIncluded (all versions)Enterprise only
Wire protocolCompatible with MySQL clientsNative
Ubuntu defaultYes (pre-18.04)Available in repos

Installing MariaDB

sudo apt update
sudo apt install -y mariadb-server

sudo systemctl enable --now mariadb
sudo mysql_secure_installation    # Same security steps as MySQL

# Connect (socket auth for root, same as MySQL 8.0):
sudo mariadb    # OR: sudo mysql (both work)

Key administration tasks

# Create database and user (identical syntax to MySQL):
sudo mariadb
CREATE DATABASE appdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'SecurePass!99';
GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

# Check MariaDB status and variables:
sudo mariadb -e "SHOW STATUS LIKE 'Uptime%';"
sudo mariadb -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"

# Backup with mysqldump (same tool works for both):
mysqldump -u root -p appdb > /backup/appdb-$(date +%Y%m%d).sql

# Restore:
mysql -u root -p appdb < /backup/appdb-20250609.sql

Storage engines

# MariaDB supports multiple storage engines:
SHOW ENGINES;

# InnoDB: default, ACID transactions, row-level locking
CREATE TABLE orders (id INT PRIMARY KEY, total DECIMAL(10,2)) ENGINE=InnoDB;

# Aria: MariaDB's improved MyISAM replacement, crash-safe
# Used internally by MariaDB for system tables
CREATE TABLE logs (id INT AUTO_INCREMENT PRIMARY KEY, msg TEXT) ENGINE=Aria;

# Check which engine a table uses:
SHOW TABLE STATUS FROM appdb;
# OR:
SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA='appdb';

Conclusion

MariaDB and MySQL share commands, client tools, and SQL syntax — if you know one, you know the other for daily administration. Choose MariaDB if you prefer a fully open-source database without Oracle's involvement, or if your Linux distribution defaults to it. Choose MySQL if you need specific MySQL 8.0 features like native JSON type or if you're following documentation that specifically targets MySQL. In either case, the administration commands in this guide apply to both.

FAQ

Is MariaDB Administration important for Ubuntu administrators?+

Yes. It supports practical Ubuntu administration because it connects directly to server reliability, security, troubleshooting, or daily operations.

Should I practice this on a live server?+

Use a lab VM first. After you understand the command output and rollback path, apply the workflow carefully on real systems.

What should I do after reading this article?+

Run the practice commands, write down what each one shows, and continue to the next article in the Ubuntu roadmap.

Need help with Ubuntu administration?

Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.

Hire Me for Support