Install & Upgrade MariaDB 10.1.12 on Ubuntu, Debian & Mint

MariaDB is a drop-in alternative for MySQL. MariaDB is an opensource Relational Database Management System (RDBMS) which supports database access. MariaDB provides more storage engines than MySQL, such as Cassandra (NoSQL, in MariaDB Edition 10), XtraDB (drop-in alternative for InnoDB), and OQGRAPH (in MariaDB Edition 10).

PREREQUISITIES

  1. These guidelines are intended for Install & Upgrade MariaDB 10.1.12 on Ubuntu, Debian & Mint
  2. SSH client like Putty and proper knowledge to use it.
  3. Some basic knowledge about common Linux commands.
  4. 20 minutes of your time with a cup of tea or coffee as always.

Step 1- Add MariaDB Repositories

By default MariaDB 5.x Series included all the Linux distributions and removed MySQL but they didn’t include MariaDB 10.x series. Use the below instructions to add MariaDB Repositories on Ubuntu, Debian & Mint.
For Debian Systems

apt-get install software-properties-common
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 
0xcbcb082a1bb943db
add-apt-repository 'deb [arch=amd64,i386] http://mirrors.opencas.cn/
mariadb/repo/10.1/debian '$(lsb_release -cs)' main'

For Ubuntu Systems

apt-get install software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 
0xcbcb082a1bb943db
add-apt-repository 'deb [arch=amd64,i386] http://mirrors.opencas.cn
/mariadb/repo/10.1/ubuntu '$(lsb_release -cs)' main'

For Mint Systems

apt-get install software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 
0xcbcb082a1bb943db
add-apt-repository 'deb http://mirrors.opencas.cn/mariadb
/repo/10.1/ubuntu trusty main'

Step 2 – Update System Repository Index

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

apt-get update

Step 3 – Install MariaDB

Once done, just run the below command to install MariaDB 10 on your systems.

apt-get install mariadb-server

During installation process, it will ask you to set root password for MariaDB.
Confirm the root password for MariaDB.

Step 4 – Start MariaDB Service

Next Use the below command to start MariaDB server.

For SysVinit Systems 
service mysql start
For systemd Systems
systemctl start mysql.service

Step 5 – Access MariaDB

Now 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)]>

Step 6- How to Upgrade MariaDB

Use the below command to Upgrade MariaDB service for new release

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

So this is all you have to do, Also read about MariaDB 10.1 installation on CentOS, RHEL & Fedora Systems.Please Give your opinion below if you experience any issues or to discuss your ideas and experiences.