Docs / Databases / How to Install MariaDB on Ubuntu

How to Install MariaDB on Ubuntu

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 236 views · 1 min read

MariaDB is a community-developed fork of MySQL with enhanced features and performance.

Install

apt update
apt install mariadb-server -y

Secure Installation

mariadb-secure-installation

Connect

mariadb -u root -p

Create Database and User

CREATE DATABASE myapp;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'SecurePassword123!';
GRANT ALL PRIVILEGES ON myapp.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;

MariaDB vs MySQL

  • Drop-in replacement for MySQL
  • Better performance for many workloads
  • Additional storage engines (Aria, ColumnStore)
  • More active community development

Was this article helpful?