This brief tutorial shows you how to install the latest version of MariaDB on Ubuntu 14.10. For those who don’t know MariaDB database server, here’s a quick description of what it is.

Couple of years ago, the default database server that was installed on almost all Linux distributions was MySQL database server. MySQL was the king of opensource databases. Almost every website that was based on the LAMP stack ran MySQL.

This began to change after Oracle bought the parent company of MySQL database server. Although the opensource community was skeptical at first, it stuck around in support of the new ownership.

MySQL was originally based on the GPL (GNU General Public License) which states that you can use the software free of charge, but you cannot modify and sell it unless you release the source code. This means you can use it in your closed-source project as well.

This license agreement didn’t fit with Oracle business model so it changed the license agreement which really drove the opensource community away. When this happened, a new group founded and folk out MySQL code and started MariaDB.

So, basically MariaDB is the same as MySQL with the full GPL licensing model. If you rip out MySQL and install MariaDB, all services that worked with MySQL will also function as if nothing was changed or replace.

This is a very brief history of MariaDB. Now that you know, lets get going.

 

  • Installing MariaDB on Ubuntu 14.10

Now to install MariaDB on Ubuntu, you must add its software repository to Ubuntu. MySQL is still the default database server on Ubuntu. It is still available through Ubuntu software repository and MariaDB is not.

To install MariaDB, run the commands below to add MariaDB repository key to your system.

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db

Next, create new repository file by running the commands below.

sudo vi /etc/apt/sources.list.d/mariadb.list

Then copy and paste the lines below and save the file.

deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main
deb-src http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.0/ubuntu trusty main

Finally, run the commands below to install MariaDB server and client on Ubuntu

sudo apt-get update && sudo apt-get install mariadb-server mariadb-client

When you run the commands above, it will prompt you to create and confirm a root password. Do it to continue.

After installing, run the commands below to secure your database server.

sudo apt-get install mysql-server mysql-client

Next, choose Yes for the rest of the prompts until you’re done.

  • Enter current password for root (enter for none): Type root password
  • Change the root password? N
  • Remove anonymous users? Y
  • Disallow root login remotely? Y
  • Remove test database and access to it? Y
  • Reload privilege tables now? Y

That’s it!

Enjoy!