← Back to team overview

maria-discuss team mailing list archive

Re: Upgrade from 10.0.12 -> 10.0.13 changes default config file location behavior; build-time "-DDEFAULT_SYSCONFDIR=" is now ignored ?

 

Hi, grantksupport!

On Aug 12, grantksupport@xxxxxxxxxxxxx wrote:
> I build MariaDB from src.
> 
> I've been running v10.0.12 (r4252).  I've upgraded to v10.0.13 (r4346).
> 
> My build config always includes
> 
> 	cmake ..  --debug-output \
> 		-DCMAKE_BUILD_TYPE="Release" \
> 		-DCMAKE_INSTALL_PREFIX=/usr/local/mariadb \
> 		-DINSTALL_LAYOUT=STANDALONE \
> 		-DINSTALL_SYSCONFDIR=/usr/local/etc/mariadb.DEFAULT \
> 		-DINSTALL_SYSCONF2DIR=/usr/local/etc/mariadb.DEFAULT/conf.d \
> 		-DDEFAULT_SYSCONFDIR=/usr/local/etc/mariadb \
> 		...
> 
> I have always kept my config only in
> 
> 	/usr/local/etc/mariadb/my.cnf
> 
> with no ~/.my.cnf in existence.
> 
> Launching MariaDB (via systemd) with
> 
> 	/usr/local/mariadb/bin/mysqld --defaults-file=/usr/local/etc/mariadb/my.cnf --basedir=/usr/local/mariadb --datadir=/var/db/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --log-error=/var/log/mariadb/mariadb-err.log --pid-file=/var/cache/mariadb/mariadb.pid --socket=/var/cache/mariadb/mariadb.sock --port=3306
> 
> with MariaDB v <= 10.0.12, changes to my config have always been
> correctly picked up, INCLUDING by all mysql client tools.
> 
> So, for example, if in my.cnf I add
> 
> 	...
> 	[client]
> 	user = root
> 	password = 'XXXXXX'
> 	...
> 
> then at shell, instead of
> 
> 	mysqlshow -u root -p
> 		password: XXXXXX
> 
> I can just
> 
> 	mysqlshow
> 
> and the options as specified are picked up.

I don't see how this could've been possible. The code doesn't search in
the @CMAKE_INSTALL_PREFIX@/etc, and I've just built MariaDB 10.0.12, and
tools aren't reading /usr/local/mariadb/etc/my.cnf file:

$ mysqldump --help
...
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/mariadb.DEFAULT/my.cnf ~/.my.cnf 
...

And 10.0.13 didn't change that.

Perhaps you've symlinked  /usr/local/mariadb/etc/my.cnf to /etc/my.cnf?
Because this was changed in 10.0.13, indeed.

Before 10.0.13 MariaDB was reading /etc/my.cnf and /etc/mysql/my.cnf
unconditionally. Since 10.0.13 it does that only if you didn't specify
INSTALL_SYSCONFDIR or DEFAULT_SYSCONFDIR. If you've explicitly specified
where your config files are, MariaDB won't look elsewhere, you can
"sandbox" it in a dedicated location and know that it won't look outside
of it.

Regards,
Sergei



Follow ups

References