← Back to team overview

maria-developers team mailing list archive

Re: MariaDB config files order

 

On 08/13/2013 06:20 PM, Honza Horak wrote:
On 08/13/2013 12:51 PM, Michael Widenius wrote:

Hi!

"Honza" == Honza Horak <hhorak@xxxxxxxxxx> writes:

Honza> Hi guys,
Honza> maybe I just need some little kick or I should get a coffee,
but I can't
Honza> understand the following config file ordering difference.

Honza> Reading [1] and code in mariadb-5.5.32/mysys/default.c:1226, it
looks
Honza> like expected order of config files in Linux should be:

Honza> /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

Honza> However, when asking for that using --help --verbose, I get a bit
Honza> different output:

Honza> $ /usr/libexec/mysqld --help --verbose 2>/dev/null | grep
--after=1
Honza> '^Default options' | tail -n 2
Honza> Default options are read from the following files in the given
order:
Honza> /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf

I checked this on my version of MariaDB (fresh from bzr) on OpenSuse:

mysqld  Ver 5.5.32-MariaDB-debug

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

Honza> I don't understand why /etc/my.cnf is not on the first place in
that
Honza> output. Can somebody give me a hint? Am I just blind?

I did check the mysqld version that comes with OpenSuse 12.3 and this
gives:

Default options are read from the following files in the given order:
/etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf

This packet is named: mariadb-5.5.29-1.1.1.x86_64 and built by
http://bugs.opensuse.org

What is the version name of the libexec/mysqld that you got and who
has built it?

Can you get the source of the package ?

Hi Monty,

thanks for your explanation so far..

It's happening on all fedora packages I've tested, currently
mariadb-5.5.31-4.fc19.src.rpm

But when trying to build from downloaded tarball with various options
I've found something interesting. When using "-DINSTALL_LAYOUT=RPM" in
the cmake call, then the order is
   /etc/mysql/my.cnf /etc/my.cnf ~/.my.cnf
but when *not* using "-DINSTALL_LAYOUT=RPM", then the order is
   /etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

I haven't found yet why is this happening, haven't spotted any
significant #IF macro or anything what could cause this.. Maybe you have
an idea?

So I've investigated a bit and found the reason and possible patch. For more info see the bug report:
https://mariadb.atlassian.net/browse/MDEV-4927

Cheers,
Honza



References