Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is the most stable/safest way to install MariaDB?

share|improve this question
    
Check this one i found on internet zobnetworks.com/tutorials/linux/… It looks kind of easy to do it. Enjoy –  user270846 Apr 19 '14 at 8:49
    
Jorge, unless I typed something wrong, that other answer didn't work on Ubuntu 15.04, the answer below did. But I've been away from Unix for 25 years so it may have been my mistake. But I guess the QUESTION is the same, so if I'm correct that the answers are wrong, maybe it just needs the answer below added to it. –  Peter John Horwood May 14 at 22:49
    
Indeed, I'll flag to merge these so that we'll have all the versions in one place, thanks. –  Jorge Castro May 15 at 10:21

7 Answers 7

up vote 27 down vote accepted
+50

For Precise Pangolin 12.04 LTS

  1. Install the repo manager

    sudo apt-get install python-software-properties
    
  2. Import the GnuPG signing key

    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
    
  3. Modify your sources.list file to add MariadDB

    Open it from terminal (gksudo gedit /etc/apt/sources.list) and add the following lines at the end:

    • 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 have the lines automatically added with:

      sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/10.0/ubuntu precise main' 
      
    • For Version 5.5:

      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
      

      Or have the lines automatically added with:

      sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu precise main'
      
  4. Refresh your system

    sudo apt-get update

  5. And finally install MariaDB

    sudo apt-get install mariadb-server

For further information see the their download page.

share|improve this answer
1  
Be aware, that this adds a second repository with the path main to your sources, which can lead to conflicts: askubuntu.com/questions/425516/… –  rubo77 Feb 25 '14 at 11:01

For 14.04 LTS and newer:

MariaDB 5.5 is included in 14.04, to install it you can do:

sudo apt-get install mariadb-server

An alternative would be to get it from MariaDB themselves by following these instructions.

share|improve this answer
    
Do you have to enable universe repos or similar? On 14.04.1 LTS I'm getting "Unable to locate package mariadb-server" –  Jason O'Neil Sep 16 '14 at 0:07

For 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 http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu $(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.

share|improve this answer
    
I get: dpkg: error processing /var/cache/apt/archives/libmysqlclient18_5.5.32+maria-1~raring_amd64.deb (--unpack): libmysqlclient18:amd64 5.5.32+maria-1~raring (Multi-Arch: no) is not co-installable with libmysqlclient18 which has multiple installed instances –  Nicolas Raoul Sep 9 '13 at 7:56
    
Using Ubuntu 13.10, I skipped the certificates/keys steps and it worked like a charm. –  user14092 Dec 7 '13 at 18:20
    
What aboout MariaDB 10? –  rubo77 Feb 18 '14 at 7:34
    
Be aware, that this adds a second repository with the path main to your sources, which can lead to conflicts: askubuntu.com/questions/425516/… –  rubo77 Feb 25 '14 at 10:53

For 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 http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu 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
# http://mariadb.org/mariadb/repositories/
deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu quantal main
deb-src http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu quantal main  

(Re)Sources:

https://kb.askmonty.org/en/installing-mariadb-deb-files/

https://downloads.mariadb.org/mariadb/repositories/

share|improve this answer
    
Be aware, that this adds a second repository with the path main to your sources, which can lead to conflicts: askubuntu.com/questions/425516/… –  rubo77 Feb 25 '14 at 11:03

At this moment, MariaDB does not have Oneiric repository, but only Natty (11.04): http://downloads.askmonty.org/mariadb/repositories/

As Oneiric is still in beta, you should wait for the final release, or try using the Natty repository.

share|improve this answer
    
Do I need to uninstall mysql before putting mariadb? –  john Oct 8 '11 at 9:31
2  
Why MariaDB is not included in normal ubuntu repositories? Does Phpmyadmin work with mariadb? –  john Oct 8 '11 at 9:31
1  
I never done it, but I think you can have both MySQL and MariaDB on system, using different ports (es. 3306 and 3307). MariaDB is not included in normal repositories, because it is not so largely used like MySQL. For PHPMyAdmin, it should work because MariaDB says to be full compatibile with MySQL connectors: kb.askmonty.org/en/mariadb-versus-mysql –  Pisu Oct 8 '11 at 13:54
1  
MariaDB is binary compatible with MySQL most things will not be able to tell the difference. Phpmyadmin will work, MySQLWorkbench works fine too on my system. When you ask for an InnoDB table you really get a XtraDB table, I have some queries that require a number of expensive inner selects... I have not found a query that performs slower on my tables and at least one important one takes only a third the time it used to. –  Quaternion Dec 1 '11 at 22:42
    
+1 for pointing to the configuration tool. –  0xC0000022L Feb 1 '13 at 3:07

Ubuntu 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 phpmyadmin

You 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-mysql

The 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.

share|improve this answer

To 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 http://tweedo.com/mirror/mariadb/repo/10.0/ubuntu 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-server

Complete guide on installing MariaDB .deb files manually can be found here

Mariadb Official Source

share|improve this answer

protected by Community Apr 19 '14 at 9:14

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.