For some reasons (and only for some days to come) we are going to have 2 cnf files in /etc/mysql/conf.d
directory, apart from the default one /etc/mysql/my.cnf
. Now I know this can be disastrous, and we are working to resolve this.
But for the sake of knowledge ….
The config of /etc/mysql/my.cnf
will be over-ridden by the cnf file in /etc/mysql/conf.d/
But between the 2 cnf files in /etc/mysql/conf.d
, lets say a.cnf
and b.cnf
, which one would take precedence and why?
MySql version is "Ver 14.14 Distrib 5.5.30, for Linux (x86_64) using readline 5.1"
Best Answer
If I understand it correctly, there can be only one config file. But mine ends with
and so it is directly responsible for "merging" those additional ones into itself.
The
!includedir
directive is covered in the manual https://dev.mysql.com/doc/refman/5.5/en/option-files.html which states:So it probably depends on the OS and filesystem but you should not depend on it anyway, even when it seems "stable" for now.
I sugget using the
!include
directive instead and maybe a different folder for those config files where the order matters.