How to install MariaDB?
Olivia Zamora
What is the most stable/safest way to install MariaDB?
38 Answers
For Precise Pangolin 12.04 LTS
Install the repo manager
sudo apt-get install python-software-propertiesImport the GnuPG signing key
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943dbModify your
sources.listfile to add MariadDBOpen it from terminal (
gksudo gedit /etc/apt/sources.list) and add the following lines at the end:For Version 10:
deb precise main deb-src precise mainOr have the lines automatically added with:
sudo add-apt-repository 'deb precise main'For Version 5.5:
deb precise main deb-src precise mainOr have the lines automatically added with:
sudo add-apt-repository 'deb precise main'
Refresh your system
sudo apt-get updateAnd finally install MariaDB
sudo apt-get install mariadb-server
For further information see the their download page.
2For 14.04 LTS and newer:
MariaDB 5.5 is included in 14.04, to install it you can do:
sudo apt-get install mariadb-serverAn alternative would be to get it from MariaDB themselves by following these instructions.
1For 13.04 Raring Ringtail / 13.10 Saucy Salamander
Install the certificates/keys:
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db Then add the repository to the end of your /etc/apt/sources.list with:
sudo add-apt-repository "deb $(lsb_release -c -s) main"And install the package:
sudo apt-get update
sudo apt-get install mariadb-server I have confirmed it on a local install.
4For 12.10 Quantal Quetzal
Install the certificates/keys:
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db Add the repository to the end of your /etc/apt/sources.list with:
sudo add-apt-repository 'deb quantal main' And install the package:
sudo apt-get update
sudo apt-get install mariadb-server If you want you can create a custom MariaDB sources.list file. Copy and paste the following into a file named MariaDB.list under /etc/apt/sources.list.d/ (it can also be added it to the bottom of /etc/apt/sources.list):
# MariaDB 5.5 repository list - created 2013-02-01 01:36 UTC
#
deb quantal main
deb-src quantal main (Re)Sources:
1Ubuntu 14.04 LTS
If you have MySQL already setup, you should remove it.
These steps allow you to preserve your existing MySQL databases. Just follow the MariaDB installation screens carefully.
(Remove MySQL)
apt-get remove --purge mysql-server mysql-client mysql-common
apt-get autoremove
apt-get autoclean
*** The above steps also remove phpMyAdmin and MySQLI
(Install MariaDB and get phpMyAdmin and MySQLI back)
apt-get install mariadb-server mariadb-client libmariadbclient-dev libmariadbd-dev phpmyadminYou might not require the dev packages.
Reconfigure phpMyAdmin to use SSL only by editing /etc/phpmyadmin/apache.conf.
At this point, most things will be working, but I had problems with my Dovecot install. So I installed the following packages as well:
apt-get install dovecot-mysql *fixed mail receipt but sending is still blocked.
apt-get install libclass-dbi-mysql-perl
apt-get install php-auth
apt-get install php-pear
apt-get install postfix-mysqlThe last 3 apt-get commands might not be necessary (since the libclass-dbi-mysql-perl package might install them), but on my Test server I needed to do them separately.
Everything on my LAMP server is now running nicely. If you have other software installed, you might need to test it to ensure you aren't missing any libraries they need.
At this moment, MariaDB does not have Oneiric repository, but only Natty (11.04):
As Oneiric is still in beta, you should wait for the final release, or try using the Natty repository.
4To install MariaDB on your Ubuntu (Vivid) system open a terminal(Ctrl+Alt+T) and run:
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 vivid main'Once the key is imported and the repository added you can install MariaDB with:
sudo apt-get update
sudo apt-get install mariadb-serverComplete guide on installing MariaDB .deb files manually can be found here
In case someone bumps on the question, MariaDB website have the "How to"
For 15.04 version 10.1 of MariaDB you just do:
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 vivid main'
sudo apt-get update
sudo apt-get install mariadb-server