my.cnf ignored

Support/Development for MySQL, MariaDB, and other database systems
nootksom
New Forum User
New Forum User
Posts: 2
Joined: Thu Jun 14, 2012 7:48 am
Location: ghetto

my.cnf ignored

Unread post 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'.
paulie
Forum User
Forum User
Posts: 76
Joined: Tue Apr 20, 2010 2:49 am

Re: my.cnf ignored

Unread post 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)
nootksom
New Forum User
New Forum User
Posts: 2
Joined: Thu Jun 14, 2012 7:48 am
Location: ghetto

Re: my.cnf ignored

Unread post 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.
Post Reply