How To Install/Upgrade MariaDB on Ubuntu, Debian & Mint

MariaDB is a drop-in replacement for MySQL. MariaDB is an opensource Relational Database Management System (RDBMS) which supports database access.

MariaDB is a logical choice for database professionals looking for a robust, scalable, and reliable SQL server.

Also read about MariaDB upgrade from 5.5, 10.0 to 10.1 & MariaDB 10.2 installation on CentOS, RHEL & Fedora Systems.

Suggested Read :
(#) How to Upgrade MariaDB 5.5 to MariaDB 10.0 & MariaDB 10.1 on Linux
(#) How To Install/Upgrade MariaDB on CentOS, RHEL & Fedora

MariaDB Features

  • More Storage Engines – The standard Storage Engines are MyISAM, BLACKHOLE, CSV, MEMORY, ARCHIVE, and MERGE. Additional Storage Engines are Aria, XtraDB, FederatedX, TokuDB, Cassandra, CONNECT, SEQUENCE, Spider also they are working on NoSQL storage engine too
  • Speed improvements – A lot of optimization done on MariaDB such as Disk access optimizations, Join optimizations, Subquery optimizations, Optimization for derived tables / views, Execution control, Optimizer control (optimizer switch) which will make MariaDB to improve the Speed overall compare with MySQL
  • Extensions & new features – They have added a lot of new features to MariaDB. If a patch or feature is useful, safe, and stable. The most notable features are Microseconds in MariaDB, Microsecond Precision in Processlist, Table Elimination, Virtual Columns, Extended User Statistics & Pluggable Authentication and for more details

Add MariaDB Repositories

By default MariaDB 5.x Series was included all the Linux distribution but they didn’t include MariaDB 10.x series and if you want Add MariaDB Repositories, use the below commands to add MariaDB Repositories on Ubuntu, Debian & Mint systems.

For Debian 8

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.fibergrid.in/mariadb/repo/10.2/debian jessie main'

For Debian 9

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64] http://mirror.fibergrid.in/mariadb/repo/10.2/debian stretch main'

For Ubuntu 17.04

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64,i386] http://mirror.fibergrid.in/mariadb/repo/10.2/ubuntu zesty main'

For Ubuntu 16.04

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.fibergrid.in/mariadb/repo/10.2/ubuntu xenial main'

For Ubuntu 14.04

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.fibergrid.in/mariadb/repo/10.2/ubuntu trusty main'

For LinuxMint 18

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
$ sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.fibergrid.in/mariadb/repo/10.2/ubuntu xenial main'

Update System Repository Index

We have added MariaDB Repository and to make it available for system, we need to refresh the system repository.

$ sudo apt-get update

Install MariaDB

After refreshing the repository, just fire the below command to install MariaDB 10 on your systems.

$ sudo apt-get install mariadb-server

While installing MariaDB server, it will ask you to set root password for MariaDB.
install-mariadb-10-1-on-ubuntu-debian-mint-1
Confirm the root password for MariaDB.
install-mariadb-10-1-on-ubuntu-debian-mint-2

Start MariaDB Service

Use the below command to start MariaDB server for further usage.

# For SysVinit Systems #
$ sudo service mysql start

# For systemd Systems #
$ sudo systemctl start mysql.service

How to access MariaDB

Use the below command to access MariaDB service.

# mysql -u root -p

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.11-MariaDB-1~jessie mariadb.org binary distribution

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

How to Upgrade MariaDB

Use the below command to Upgrade MariaDB service for new release

$ sudo apt-get install --only-upgrade mariadb-server

Also read about phpMyAdmin Installation and configuration which will help you to manage the MariaDB database on Web without headache and if you want to upgrade phpMyAdmin to latest version, this will help you the steps.

Please stay tune with us…Good Luck.

Magesh Maruthamuthu

Love to play with all Linux distribution

You may also like...