Page 1 of 1

my.cnf ignored

Posted: Thu Jun 14, 2012 7:58 am
by nootksom
Hi.

I'm using atomic yum repo mysql Ver 14.14 Distrib 5.5.25, for Linux (x86_64) using readline 5.1 on CentOS 6.2 x64.

It ignores settings from my.cnf. "show variables" shows that the setting is read from config but the server is not using it.

For example I enabled binlog in my.cnf, New path shows up in variables, but the server isn't writing the log and as a sequence show master status returns empty set;

Config:
bind-address=127.0.0.1
log-bin=/var/lib/mysql/mysql-bin.log
log-bin-index=/var/lib/mysql/mysql-bin.index

show variables:
log /var/lib/mysql/db1.log
log-bin /var/lib/mysql/mysql-bin
log-bin-index /var/lib/mysql/mysql-bin.index

Same thing with bind-address. Even though it's specified in config to bind to loopback, netstat still shows 0.0.0.0:3306

When started from console like this /usr/libexec/mysqld --bind-address=127.0.0.1, it both binds to loopback and writes the binlog. Hence it's not a perms problem.

Anyone else experienced this? What could be the problem, I'm out of ideas.

UPDATE:
Disregard.
I also get the same behaviour on Percona Server 5.5.
Looks like it has something to do with networking as I get this in error log

120614 17:45:13 [Note] Server hostname (bind-address): '(null)'; port: 3306
120614 17:45:13 [Note] - '(null)' resolves to '0.0.0.0';
120614 17:45:13 [Note] - '(null)' resolves to '::';
120614 17:45:13 [Note] Server socket created on IP: '0.0.0.0'.

Re: my.cnf ignored

Posted: Thu Jun 14, 2012 3:16 pm
by paulie
Hi,

It sounds like your configuration entries are in the wrong place, they should all be placed AFTER "[mysqld]" and BEFORE any other "[mysql.*]" entries.

If you do have the my.cnf in the right place then please can you paste your entire my.cnf into a post along with the output of :

ps aux | grep mysql

(Hopefully that'll tell us if its looking somewhere different for the my.cnf)

Re: my.cnf ignored

Posted: Fri Jun 22, 2012 11:49 am
by nootksom
As silly as it gets.

It was a SELinux problem. my.cnf had an incorrect context and therefore wasn't used by MySQL.
As soon as I restorecon'ed it, all settings got applied.

PS: Forgot about this post because of pre-moderation. Thought I should post in case, very improbable, someone else forgets about SELinux.