Bug #46316 error log value is ignored in my.cnf
Submitted: 20 Jul 2009 22:33 Modified: 7 Mar 2012 2:38
Reporter: monty solomon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S2 (Serious)
Version:mysql-5.1.36-linux-x86_64-icc-glibc23 OS:Linux
Assigned to: CPU Architecture:Any
Tags: log_error, log-error, option, variable

[20 Jul 2009 22:33] monty solomon
Description:
MySQL is ignoring the value of log-error in the option file (/etc/my.cnf) and using the default value (host_name.err in the data directory).

MySQL 5.1.36 was installed from the tarball in /usr/local on a RHEL 5 server which also has MySQL 5.0 installed (via RPM).

How to repeat:
Create /etc/my.cnf file as follows. Start MySQL 5.1.  Observe the name of error log file.

[client-5.1]
port=3306
socket=/var/lib/mysql51/mysql.sock
default-character-set=utf8

[client-5.0]
port=3305
socket=/var/lib/mysql/mysql.sock
default-character-set=utf8

[mysqld-5.1]
basedir=/usr/local/mysql51
datadir=/san12/mysql51
port=3306
socket=/var/lib/mysql51/mysql.sock
pid-file=/var/run/mysqld/mysqld51.pid
tmpdir=/u01/tmp/mysql51
default-character-set=utf8
long_query_time=10
slow_query_log = 1
slow_query_log_file = /u01/log/mysql51/slow_queries.log
log-queries-not-using-indexes
log-error=/var/log/mysqld51.log
log_error=/var/log/mysqld51.log

[mysqld-5.0]
basedir=/var/lib
datadir=/san12/mysql
port=3305
socket=/var/lib/mysql/mysql.sock
pid-file=/var/run/mysqld/mysqld.pid
tmpdir=/u01/tmp/mysql
default-character-set=utf8
long_query_time=10
log-slow-queries = /u01/log/mysql/slow_queries.log
log-queries-not-using-indexes
log-error=/var/log/mysqld.log
log_error=/var/log/mysqld.log
skip-bdb

[mysql.server]
user=mysql

[mysqld_safe-5.1]
err-log=/var/log/mysqld51.log
err_log=/var/log/mysqld51.log
pid-file=/var/run/mysqld/mysqld51.pid
log-error=/var/log/mysqld51.log
log_error=/var/log/mysqld51.log

[mysqld_safe-5.0]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log-error=/var/log/mysqld.log
log_error=/var/log/mysqld.log

[mysqld]
wait_timeout=31536000

expire_logs_days=1

binlog_cache_size = 1M
max_binlog_size = 500M

skip-locking
key_buffer_size = 2GB
max_allowed_packet = 4M
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
net_buffer_length = 2K
thread_stack = 192K
myisam_sort_buffer_size = 256M
query-cache-type = 1
query-cache_limit = 4M
query_cache_size = 384M
thread_cache_size = 32
table_cache = 512
join_buffer_size = 1M

thread_concurrency = 8

innodb_file_per_table
innodb_flush_log_at_trx_commit = 2
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 20M
innodb_log_file_size = 100M
innodb_log_buffer_size = 8M
innodb_lock_wait_timeout = 50
innodb_flush_method = O_DIRECT

auto_increment_increment = 2
auto_increment_offset = 2

max_connections = 40

open-files-limit = 8192

[mysqld]
server-id = 4
replicate-same-server-id = 0

[mysql]
no-auto-rehash

[client]
port=3306
socket=/var/lib/mysql51/mysql.sock
default-character-set=utf8
[21 Jul 2009 7:23] Sveta Smirnova
Thank you for the report.

But where did you see documentation about "[mysqld_safe-5.1]" should work?
[21 Jul 2009 8:30] Sveta Smirnova
Thank you for the feedback.

But at the links provided there is no word about  "[mysqld_safe-5.1]" would work:
"[mysqld_safe-5.1]" is not "[mysqld-5.1]"

So closed as "Not a Bug"
[21 Jul 2009 12:13] monty solomon
mysqld_safe reads all options from the [mysqld], [server], and [mysqld_safe] sections in option files and should therefore also read the [mysqld-5.1], [server-5.1], and [mysqld_safe-5.1] sections when running a version 5.1 server.
[21 Jul 2009 18:05] Sveta Smirnova
Thank you for the feedback.

Got your point: mysqld_safe rejects to read even from  [mysqld-5.1] part of the configuration file.

Verified as described.

But still to be accurate: "mysqld_safe reads all options from the [mysqld], [server], and [mysqld_safe] sections in option files." (http://dev.mysql.com/doc/refman/5.1/en/mysqld-safe.html)
[22 Jul 2009 22:32] monty solomon
According to section 5.2.2. The Error Log

http://dev.mysql.com/doc/refman/5.1/en/error-log.html

If you specify --log-error in an option file in a section that mysqld reads, mysqld_safe also will find and use the option.
[22 Jul 2009 22:36] monty solomon
According to section 5.2.2. The Error Log

http://dev.mysql.com/doc/refman/5.1/en/error-log.html

If you specify --log-error in an option file in a section that mysqld reads, mysqld_safe also will find and use the option.
[26 Jul 2011 4:33] MySQL Verification Team
path to read [mysqld-5.1] and [mysqld_safe-5.1]

Attachment: patch-mysqld_safe (application/octet-stream, text), 636 bytes.

[7 Mar 2012 2:38] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Revised wording:

If you specify --log-error in an option file in a [mysqld], [server],
or [mysqld_safe] section, mysqld_safe will find and use the option.