Installing MariaDB on Ubuntu 12.04 LTS

MariaDB is a community-developed fork of MySQL, and aims to be an enhanced, drop-in replacement for it. It is GNU GPL licensed, and led by the original developers of MySQL. The impetus leading to its creation was triggered by concerns over MySQL being acquired by the commercial company, Oracle.

This tutorial assumes that you do not already have MySQL installed and running.

To install MariaDB on Ubuntu 12.04 LTS, you will need to ssh to your Pod as root, or use sudo to run the commands as root. You can then follow these steps:

Install the repo manager:

root@mypod:~# sudo apt-get install python-software-properties

Import the GnuPG signing key:

root@mypod:~# sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db

For this next step, you must choose to either add the Version 10 branch or the Version 5 branch. MariaDB 10.0 is the development version of MariaDB which is built on the MariaDB 5.5 series with backported features from MySQL 5.6 and includes new features. MariaDB 5.5 is the current stable (GA) release of MariaDB. It is MariaDB 5.3 + MySQL 5.5.

To automatically add Version 10 to /etc/apt/sources.list file:

root@mypod:~# sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main' 

OR, for version 5.5:

root@mypod:~# sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main'

You will find that these two lines were added to the bottom of the sources.list file for version 10:

deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main
deb-src http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main

Or if you are going to install 5.5, these lines were added:

deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main
deb-src http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main)

Finally, update your package lists and install. We recommend setting a secure password for the root user when asked.

root@mypod:~# sudo apt-get update
root@mypod:~# sudo apt-get install mariadb-server

You can now test that the install of MariaDB worked by connecting as you would with MySQL. Enter the root user’s password when asked:

root@mypod:~# mysql -u root -p -hlocalhost

To learn more about MariaDB, visit the MariaDB Web Site.

Matthew McCaffrey

Leave a Reply