How to install MariaDB in Ubuntu 16.04

Created:

2016-12-12 03:46:31 UTC

Modified:

2017-08-08 13:08:35 UTC

2

Was this article helpful?


Have more questions?

Submit a request

How to install MariaDB in Ubuntu 16.04

Applicable to:

  • Plesk Onyx for Linux

Question

How to install MariaDB in Ubuntu 16.04?

Answer

Direct upgrade from MySQL 5.7 to MariaDB 10.x is not possible because MySQL 5.7 (at least) has an incompatible schema of mysql tables. It is not recommended to perform these actions with installed Plesk.

  1. "Remove" mysql first.Since it is not possible to remove mysql-related packages due to package dependencies (it will try to remove half of Plesk) it is required to do at least the following:
  2. move directory /var/lib/mysql :

        # mv /var/lib/mysql{,.bak}
  3. "upgrade" packages. For example:

        # aptitude install --purge  mysql-client-5.7- mysql-client-core-5.7- mysql-server- mysql-server-5.7- mysql-server-core-5.7- mariadb-server mysql-common

    (packages with siffux "-" will be removed, mariadb-server will be installed instead)
    • if you tried to upgrade packages and failed, you can move /var/lib/mysql and reinstall mariadb-server with: aptitude reinstall mariadb-server-10.1

      (Note: keep password empty when aptitude asks you to set new password)

  4. "Install" mariadb then.Actually, mariadb is already installed but we need to perform mysql_upgrade now.

  5. Try to install Plesk.

Have more questions? Submit a request

2 Comments

Please sign in to leave a comment.