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?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Both are global options. In this case,
is an SYSCONFDIR generate by ubuntu when Mysql was compiling for the package in CMAKE option.
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
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.