MariaDB is a community-developed fork of MySQL, designed to remain free and open source. It offers enhanced performance, additional storage engines, and better replication compared to MySQL.
📑 Table of Contents
Key Features
- MySQL Compatibility: Drop-in replacement
- Storage Engines: Aria, ColumnStore, Spider, and more
- Performance: Optimized query execution
- Galera Cluster: Multi-master replication
- JSON Support: Native JSON functions
Installation
Install MariaDB on Ubuntu:
sudo apt update
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo systemctl enable mariadb
Usage Examples
MariaDB operations:
# Connect to MariaDB
sudo mariadb -u root -p
# Create database
CREATE DATABASE webapp;
# Create table with JSON column
CREATE TABLE products (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255),
attributes JSON
);
# Query JSON data
SELECT name, JSON_VALUE(attributes, '$.color')
FROM products WHERE JSON_VALUE(attributes, '$.size') = 'large';
Benefits
MariaDB provides MySQL compatibility with additional features and active development. Its community-driven approach ensures long-term stability and openness.
Was this article helpful?