• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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.

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