MariaDB installation guide

Plesk uses MySQL as both admin and client RDBMS. Plesk 11.5 for Linux and higher allows for MySQL alternatives (such as MariaDB or Percona Server) to be used as drop-in replacements for it. Upgrade from installations with drop-in replacements is also supported.

This guide will explain in great detail how you can replace MySQL server on a Plesk installation with MariaDB server. The guide is aimed at administrators with intermediate experience and understanding of package management for their OS. Also basic experience with services management and MySQL maintenance required.

This guide is essentially a more detailed version of the official documentation page. Please read up to the end of this guide before doing any actual changes on your server.

Repositories Setup

MariaDB is available from vendor OS repositories only on SuSE 12.2 and higher. On any other OS third-party repository should be added.

Go to https://downloads.mariadb.org/mariadb/repositories/ to generate repositories configuration appropriate for your system. Simple wizard will guide you through the process. On step 3 “Choose a Version” choose 5.5 or below. Don’t attempt to install MariaDB as drop-in replacement with version less than you had (for MySQL) before! We don’t support MySQL 5.6 and drop-in replacements based on it yet as well.

Warning: Don’t disable MariaDB repository after you’ve installed it. Plesk will require it to be enabled for updates.

Installing MariaDB

Since even on a freshly installed machine you may have parts of MySQL preinstalled, we will give a single instruction for both clean installation and drop-in replacement of MySQL. Steps that require Panel to be installed may be skipped if it is not installed yet.

Before doing drop-in replacement ensure that version of MariaDB server you are about to install is either the same (preferable) as current MySQL version, or higher. After installing a drop-in replacement you may optionally execute following command to notify Panel that MySQL component was updated:

Please note that during installation you have an option to either retain old my.cnf or install the one packaged with MariaDB.

By now MariaDB daemon is already running and automatic table structure upgrade was performed if required. If you have previously disabled WatchDog it’s now time to enable it.

If you experience MySQL errors (especially related to InnoDB), restore previously created backup as described in Installing Using Yum (CentOS & RedHat).

If your machine doesn’t have any part of MySQL installed, you may greatly simplify this procedure and instead call a simple command:

Shell

1

# apt-get install mariadb-server

If during installation you are asked to enter new MariaDB password, don’t specify it (just hit <Enter>). Otherwise Plesk will not be able to guess your password and access DB server (in other words installation will fail).

Interesting observation: if on Debian 6 or Ubuntu 10.04 and MariaDB 5.5 is installed, then libmysqlclient16 will still be provided by OS vendor. But it works quite OK with MariaDB.

You can switch back to mysql-community-server the same way. Note that while switching between MySQL variants /etc/my.cnf configuration file may be overwritten. Usually old version is saved to /etc/my.cnf.rpmsave.

Clean Installation of Plesk with MariaDB

Here and below AI means Parallels Installer or Autoinstaller.

Install MariaDB using steps described in Installing MariaDB.

Install Plesk 11.5.30 or later as you would normally. Make sure system MySQL server (mysql-sys AI component, “MySQL server support”) is selected if there is an option to install one packaged by Parallels:

Shell

1

2

3

Different MySQL server versions

13. (=) MySQL server support

14. ( ) MySQL v5.5 (packaged by Parallels)

Enjoy!

Installing MariaDB as a drop-in replacement for MySQL

If you have a Plesk with MySQL and want to replace it with MariaDB, follow these steps.

Upgrade to Plesk 11.5.30 or later via AI.

Replace MySQL with MariaDB using steps described in Installing MariaDB.

Enjoy!

If you want to install MariaDB on any previous Plesk version, you can still do that, but there are 2 caveats:

You will need to somehow disable automatic package updates to Plesk via AI. Otherwise AI will attempt to install OS vendor version of MySQL, which will either fail or wreck your installation.

You may encounter package dependency problems during replacing MySQL compared to the guide in Installing MariaDB.

Here’s one trick that will disable any automatic updates via AI. Place following strings in /root/.autoinstallerrc:

MS DOS

1

2

3

#DisableAItoavoidpackageupdates,soMariaDBdoesn'tgetbroken.

PROXY_HOST=ai-is-manually-disabled

PROXY_PORT=1

This will make AI fail on any operation. This will obviously disable installation of patches and update notifications as well. We do not recommend doing this! Remember that keeping your Plesk installation up-to-date is essential to keep your server secure!

Provided you succeed, such installation may later be safely upgraded to latest Plesk version. See below.

Thanks so much for this nice tutorial. I normally use Gnome’s software update gui for updates, and I noticed that maradb show as an upgrade. Does not YUM take care of removing and installing mariadb by itself? will I have any later problems if I simply run the upgrade from the gui? I have mysql 5.5 and I want to switch to mariadb 5.5