• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Where to add custom MariaDB variables to avoid them getting overwritten

TurnRound

New Pleskian
Server operating system version
Ubuntu 22.04.5 LTS
Plesk version and microupdate number
Plesk Obsidian 18.0.64 Update #1
We've got Plesk running on a server with Ubuntu 22.04.5 LTS.

I've followed the Plesk instructions here to customise various MariaDB configuration options. It say's on Ubuntu-based distributions to add your custom variables under the [mysqld] section of the /etc/mysql/my.cnf file, which is what I've done and it works ok.

However, twice in the last couple of months, this /etc/mysql/my.cnf file has got reset to default (all customisations removed) during the night when (presumably) Plesk is doing some updates. I can't find which update resets this file.

How do I stop this from happening? Is there another place I should make these customisations that won't get reset?

I notice at the top of the /etc/mysql/my.cnf file is the following comment:

Code:
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.

Should I add my customisations to one of these locations instead? If so, which one?

Thank you.
 
We've got Plesk running on a server with Ubuntu 22.04.5 LTS.

I've followed the Plesk instructions here to customise various MariaDB configuration options. It say's on Ubuntu-based distributions to add your custom variables under the [mysqld] section of the /etc/mysql/my.cnf file, which is what I've done and it works ok.

However, twice in the last couple of months, this /etc/mysql/my.cnf file has got reset to default (all customisations removed) during the night when (presumably) Plesk is doing some updates. I can't find which update resets this file.

How do I stop this from happening? Is there another place I should make these customisations that won't get reset?

I notice at the top of the /etc/mysql/my.cnf file is the following comment:

Code:
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.

Should I add my customisations to one of these locations instead? If so, which one?

Thank you.
FWIW You've not (so far) stated what MariaDB release you're using.
That might be relevant, because, some time ago (MariaDB 10.5 -> 10.6, from memory and, by default too) MariaDB changed /etc/mysql/my.cnf to become just a symlink to /etc/mysql/mariadb.cnf This was part of MariaDB's continued process of slowly removing all references to MySQL
You can see that this is stated (as a reminder) in points 0. and 1. in your post above.
So other than ensuring that it IS indeed a symlink, you can ignore /etc/mysql/my.cnf now and add all of your customisations to "/etc/mysql/mariadb.cnf and/or within the other two sub-folders: /etc/mysql/conf.d/ and /etc/mysql/mariadb.conf.d/ if needed.
We've done exactly that ^ ever since MariaDB 10.6.* without the issues that you've experienced and, after numerous (manual) Plesk upgrades too.
 
Thank you. Apologies for omitting the MariaDB version - it is 10.11.10, and yes, /etc/mysql/my.cnf is a symlink to /etc/mysql/mariadb.cnf.

So, going forward, if I add any customisations to /etc/mysql/mariadb.cnf that file shouldn't get overwritten in the future by any automatic Plesk/server updates?

Thanks for your help.
 
So, going forward, if I add any customisations to /etc/mysql/mariadb.cnf that file shouldn't get overwritten in the future by any automatic Plesk/server updates?
Correct. We don't update Plesk via auto-updates, we do them all manually, but it's the same process, so you'll be fine.
If you want 100% total piece of mind (in advance of the next Plesk upgrade) you could take a snapshot of your server and/or run a full MariaDB backup and/or take a local back up of just your /etc/mysql/mariadb.cnf Any of those, will give you an easy recovery position, but very sure that won't be needed anyway.
 
Back
Top