While MariaDB makes sense on current web servers, a lot of services still rely on the systemd service mysql. Or at least rely on an alias like mysql or mysqld. One current example are Plesk updates on systemd OSs. Esspecially those where mysql was substituted with a MariaDB 10.1 dropin. Here Plesk updates fail due to no available mysql server. What is going on?

MariaDB 10.1 and systemd

On RHEL, CentOS, Fedora and ScientificLinux, the MariaDB 10.1 repository fails to correctly supply the systemd aliases of mysql (mysql.service and mysqld.service) for “mariadb.service”. Therefore the aliases mysql and mysqld are not able to restart MariaDB via systemd. Any update script relying on a systemd restart of MariaDB via mysql or mysqld will fail.

# systemctl restart mysqld

# systemctl restart mysqld

Cause and solution

The cause is simple: MariaDB aliases were not properly set up in systemd. We can fix that easily:

# systemctl stop mariadb.service
# systemctl disable mariadb.service
# systemctl enable mariadb.service
# systemctl daemon-reload
# systemctl start mariadb.service

That’s it already. First we stopped MariaDB. Second we disabled mariadb service, while deleting the old soft links. Third we re-enabled MariaDB via systemd. Thereby we have the soft links rewritten and properly set up. Fourth a daemon-reload reinitialized the new aliases in systemd. Last but not least we start MariaDB.

Voilá