As per title. In /etc/mysql/my.cnf
I see:
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
.cnf files from both location are loaded: why having two? Which one is the "right one" for my own .cnf?
As per title. In /etc/mysql/my.cnf
I see:
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
.cnf files from both location are loaded: why having two? Which one is the "right one" for my own .cnf?
In my case I had to add all my changes to the directory /etc/mysql/mysql.conf.d/
because it gets loaded last. So I added a file zz_myconfig.cnf
to that directory with all my changes. The other way around the configuraion from /etc/mysql/mysql.conf.d/mysqld.cnf
would overwrite my settings again which is unfortunate.
If the directory /etc/mysql/conf.d
is the official way to go then it should also be the last include directory within /etc/mysql/my.cnf
.
Both are global options. In this case,
!includedir /etc/mysql/mysql.conf.d/
is an SYSCONFDIR generate by ubuntu when Mysql was compiling for the package in CMAKE option.
More info https://dev.mysql.com/doc/refman/8.0/en/option-files.html
The default configuration files in the two subdirectories suggest conf.d
is intended for Client config and mysql.conf.d
is intended for Server config:
root@ubuntu-focal:~# grep "configuration file" /etc/mysql/conf.d/* etc/mysql/mysql.conf.d/*
/etc/mysql/conf.d/mysql.cnf:# The MySQL Client configuration file.
/etc/mysql/mysql.conf.d/mysqld.cnf:# The MySQL Server configuration file.