How to Install MariaDB in Ubuntu 14.04 LTS

MariaDB is an Open Source database Server & It is 100 % compatible  with MySQL, drop-in replacement to MySQL database server.

Background of MariaDB :

In 2008, MySQL was acquired by Sun Microsystems, which was in turn acquired by Oracle Corporation in 2010. While the initial acquisition by Sun was hailed by many in the MySQL community as exactly what the project needed, that sentiment did not last, and the subsequent acquisition by Oracle was unfortunately met with far lower expectations. Many of MySQL’s developers left Sun and Oracle to work on new projects . Among them was Michael ‘Monty’ Widenius, creator of MySQL and one of the project’s longtime technical lead. Monty and his team created a fork (offshoot) of the MySQL code base and named his new DBMS MariaDB

In this Post we will discuss how to install MariaDB in Ubuntu Linux. By default mariadb packages are not included in Ubuntu Repositories. So to install mariadb , we we have set MariaDB repository.

Setting Up MariaDB Repository

$ sudo apt-get install software-properties-common
$ sudo apt-key adv --recv-keys --keyserver hkp:// 0xcbcb082a1bb943db
$ sudo add-apt-repository 'deb trusty main'

Installation of MariaDB :

$ sudo apt-get update
$ sudo apt-get install mariadb-server

While Installing MariaDB , you will be asked to set Maria DB root Password.


Connect To MariaDB From the Command Line :

[email protected]:~$ mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 40
Server version: 10.0.14-MariaDB-1~trusty-log binary distribution
Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>

Maria DB Service

$ sudo /etc/init.d/mysql stop
$ sudo /etc/init.d/mysql start

1 thought on “How to Install MariaDB in Ubuntu 14.04 LTS”

  1. Ted @ The Digital Orchard

    I’ve been battling the installation of MariaDB on Ubuntu 15.04 for days now. Every tutorial that I read states that the installer will prompt for a root user, yet that never happens for me. Is this a quirk with the version provided through Ubuntu? I read that somewhere.

    I’m able to get it installed, run mysql_secure_installation, etc, but the resulting installation has too many files owned by ‘root’, not the ‘mysql’ user, so I’m not able to log into as [email protected] This has been very frustrating and one of the reasons why I’ve been switching to MongoDB for new sites and applications. Setting up MySQL has too many “gotchas”.

    Suggestions? Advice? Fool-proof installation steps?

Leave a Reply

Your email address will not be published. Required fields are marked *