I already have several MySQL DBs running on my Ubuntu 14.04 Server, and I would like to migrate these as smoothly as possible to the compatible MariaDB. I'm also using PHPMyAdmin. Is there a different way to do this than to export all data and then reimport it all after installation?

2 Answers 2


It turned out to be as simple as:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mariadb-server

This won't break your phpmyadmin, or any webapp, as long as you say no, when asked if you want to delete your database and you use the same credentials you used for you mysql-DB. Also back up your data before doing this.

  • What about migrating settings? Surely these have separate configuration locations in /etc and (likely) different configuration syntax? Oct 5, 2014 at 10:23
  • 1
    It will migrate settings automatically, but warn you about possible incompatibilites when installing mariadb Oct 5, 2014 at 11:21
  • 2
    It didn't ask for me an option to delete any databases, also used my old my.cnf as base configuration. This was one of the smoothest upgrades I've done so far.
    – Arda
    Nov 5, 2014 at 21:04
  • Also, to mention official site of MariaDB has newer versions available for installation as repositories or debs. Ubuntu repos currently give me v5.5, but mariadb repos give me v10.1, which has quite a bit differences.
    – Arda
    Nov 5, 2014 at 23:05
  • 1
    When you uninstall MySQL it should've asked you whether to remove the databases Nov 6, 2014 at 7:31

Andreas Hartmann's answer is incomplete, and it also removes PHPMYADMIN and MYSQLI

So, in addition to mariadb-server, you should install the following:

apt-get install mariadb-client libmariadbclient-dev libmariadbd-dev phpmyadmin

To get phpMyAdmin working again on SSL only, you'll need to reconfigure etc/phpmyadmin/apache.conf to include the http=>https rewrite.

If you're running a LAMP server with Postfix with Dovecot, you will also need to do the following:

**** Everything worked except MAIL.  Dovecot not configured properly and can’t send/receive mail.
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 three (3) apt-get statements might not be necessary, since libclass-dbi-mysql-perl might install them for you, depending on how update your package list is.

If you are running other software, you will need to test it and install any missing libraries that might have been removed by auto-dependency calculations.

The FTP service was removed as well (PureFTPD in my case) and needed to be installed: apt-get install pure-ftpd-common pure-ftpd-mysql

  • 2
    Actually, for me phpmyadmin wasn't removed. Also, I doubt that you would need these packages just to get the server running, especially these dev packages are meant for developers and not for end users. Jan 20, 2015 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .