Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

At some point Percona MySQL on CentOS 6.4 seems to have stopped reading my.cnf, possibly after MySQL updated to 5.5.33 a few days ago.

Selection from /etc/my.cnf:

[mysqld]

# GENERAL #
user                    = mysql
default-storage-engine  = InnoDB
socket                  = /var/lib/mysql/mysql.sock
pid_file                = /var/run/mysql.pid
symbolic-links          = 0 

# CHARACTER SET AND COLLATION #
collation-server        = utf8_unicode_ci
character-set-server    = utf8
init-connect            = 'SET NAMES utf8'
init-connect            = 'SET collation_connection = utf8_unicode_ci'

# DATA STORAGE AND LOGGING #
datadir                 = /var/lib/mysql
tmpdir                  = /tmp
slow_query_log_file     = mysql-slow.log
slow_query_log          = 1 
long_query_time         = 8 
log_error               = mysql-error.log

# CACHES AND LIMITS #
max_connections         = 250
max_connect_errors      = 10000
open_files_limit        = 20000
back_log                = 100
wait_timeout            = 10800
interactive_timeout     = 600
max_allowed_packet      = 256M
tmp_table_size          = 512M
max_heap_table_size     = 64M 
query_cache_size        = 32M
thread_cache_size       = 64

Some output from 'mysqld --help --verbose'

log-error                                         mysql-error.log
slow-query-log                                    TRUE
slow-query-log-file                               mysql-slow.log
max-connections                                   250
max-heap-table-size                               67108864

Ok that seems good, matches my config. How about logging into mysql and doing some SHOW VARIABLES:

log_error   /var/lib/mysql/hostname.err
log_slow_queries    OFF
slow_query_log_file /var/lib/mysql/hostname-slow.log
max_connections 151
max_heap_table_size 16777216

Huh, well that ain't right. Slow log is off, error log has the wrong name, connection and heap sizes are wrong, and the server collation is wrong as well.

Processes running

root     23533     1  0 12:32 pts/3    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/hostname.pid
mysql    23624 23533 91 12:32 pts/3    01:05:32 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/hostname.err --pid-file=/var/lib/mysql/hostname.pid

I see the error log listed in the process has the wrong name right off the bat. I've tried manually restarting mysql from /etc/init.d, via 'service mysql restart', via restarting the entire server. Nothing seems to get MySQL to read the conf.

Maybe something is breaking when mysqld_safe spins up a mysql instance? No problems reported in the error log when the server starts. Any ideas?

share|improve this question
    
Try this answers. stackoverflow.com/questions/580331/… Ahh, i need 30 characters in post. –  netneladno Sep 17 '13 at 20:57
    
stat("/etc/my.cnf", {st_mode=S_IFREG|0644, st_size=5209, ...}) = 0 open("/etc/my.cnf", O_RDONLY) = 3 (run mysqld directly and the my.cnf is obeyed, as noted in my OP, but when run as a system service it is not using my.cnf) –  xref Sep 17 '13 at 21:09
    
whell may be they moved config into /etc/mysql/my.cnf –  netneladno Sep 17 '13 at 21:19
    
as of stackoverflow.com/a/12246575 –  netneladno Sep 17 '13 at 21:19
1  
i just don't have centos to investigate, look at the init script –  netneladno Sep 17 '13 at 21:20
show 1 more comment

1 Answer

up vote 1 down vote accepted

Ultimately the problem was SELinux on CentOS, and the answer was to disable SELinux! I couldn't find any errors in the SELinux log related to MySQL so this took quite some time to track down.

share|improve this answer
    
+1 the first question should always be, "what else changed?" ;-) –  Bill Karwin Dec 3 '13 at 0:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.