Ubuntu Linux

How to Install MariaDB on Ubuntu 18.04

This tutorial explains how to install MariaDB on Ubuntu 18.04 bionic beaver. MariaDB is a relational database management system like MySQL, in fact, it is based on MySQL and the MariaDb project started by the same people who originally developed the MySQL database.


To install MariaDB, you will require shell access to your Ubuntu server with root privileges.

MariaDB is in the Ubuntu universe apt repository, so make sure it is enabled:

add-apt-repository universe
apt-get update

After that install the mariadb-server package:

apt-get install mariadb-server

After you install the mariadb-server package. MariaDB should start automatically. If not, run following two commands to start and enable MariaDB:

systemctl start mariadb
systemctl enable mariadb

Run the status command to make sure the service started and is enabled:

systemctl status mariadb
● mariadb.service - MariaDB 10.1.34 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-10-11 05:20:59 UTC; 2h 31min ago
     Docs: man:mysqld(8)
 Main PID: 3532 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 27 (limit: 505)
   CGroup: /system.slice/mariadb.service
           └─3532 /usr/sbin/mysqld

Login to the MariaDB root console, simply type:

sudo mysql

Next: How to Install phpMyAdmin in Ubuntu.