0

After a small update ran by an Ansible playbook from MariaDB 10.5.4 to MariaDB 10.5.5, the custom configuration file got silently overriden by the default configuration causing the server to refuse connection because the valid custom configuration was no longer present.

Our custom configuration file was stored under /etc/mysql/my.cnf

My question is: What is the best practice to store the custom configuration so it never again gets replaced by the default one when an update comes out

Is it /etc/mysql/conf.d/ ?

Distribution: Debian 10 installed with the official repository: https://downloads.mariadb.com/MariaDB/mariadb-10.5/repo/debian

3
  • I'd say that depends on the distribution and how MariaDB was installed (system, third party repo, from source etc.) Commented Sep 17, 2020 at 8:42
  • It's a Debian 10 :) Commented Sep 17, 2020 at 8:43
  • It was installed with the official repository: downloads.mariadb.com/MariaDB/mariadb-10.5/repo/debian Commented Sep 17, 2020 at 8:49

2 Answers 2

3

Yes, you're meant to leave the default configuration alone and place your configuration snippets in files in /etc/my.cnf.d/ (the location used by MariaDB upstream) or Debian's nonstandard location /etc/mysql/mariadb.conf.d/ or wherever your particular MariaDB packages locate this directory.

1

I would suggest creating an ansible patches role that will store you customized my.cnf file and in case it does not match content will be updated.

Our best practice we do is to run a patch role after every update is done to ensure all customizations will be in place. It saved us a lot of time with this practice.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.