Bug #83059 Can't use mysqld_safe without error log file
Submitted: 20 Sep 2016 11:44 Modified: 21 Sep 2016 19:43
Reporter: Matthias Burtscher Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.7.15 OS:Ubuntu
Assigned to: CPU Architecture:Any

[20 Sep 2016 11:44] Matthias Burtscher
Description:
The MySQL server documentation states that omitting the `--log-error` option will cause logging to the console instead:

> Without --log-error, mysqld writes error messages to the console.

Omitting `--log-error` when using `mysqld_safe` however will fall back to the default log file ([hostname].err) although this behavior should only be used when `--log-error` is provided WITHOUT A VALUE:

> If no file is named, mysqld writes to the default log file.

(http://dev.mysql.com/doc/refman/5.7/en/error-log.html)

How to repeat:
1. Remove all `log_error` definitions from your configuration files.
2. Start MySQL with `mysqld_safe` omitting the `--log-error` parameter.
[21 Sep 2016 8:37] Terje Røsten
Hi!

The sentence 
 If no file is named, mysqld writes to the default log file.

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

is correct, however when using mysqld_safe wrapper thing changes.

From the same URL:

 mysqld_safe has three error-logging options, --syslog, --skip-syslog, and
 --log-error. The default with no logging options or with --skip-syslog 
 is to use the default log file.

Do you really need to use mysqld_safe?
[21 Sep 2016 14:57] Matthias Burtscher
Oh I'm sorry I missed the notes on mysqld_safe.

I think we don't really *need* mysqld_safe, we were just using it because all examples and documentation say that this is the recommended way to start the server.
[21 Sep 2016 15:20] Terje Røsten
For systemd platforms mysqld_safe is not used any more, it does more harm than good. Your case seems to be similar.
[21 Sep 2016 19:43] Matthias Burtscher
Marked with "Not a bug" – using mysqld now.