I have installed Multiple MySQL instances and i have two configuration files one for each one is using default location of /etc/mysql/my.cnf.

other server i have started like

root@ABC-240:/usr/local/mysql# bin/mysqld_safe  --defaults-file=/etc/mysql/binary_my.cnf &

root@ABC-240:/usr/local/mysql# 120104 10:19:34 mysqld_safe Logging to syslog.
120104 10:19:34 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

I have set the error log in both of the configuration files but one of them as above is logging to syslogs.

Why is it like that?

  • what does the /etc/mysql/binary_my.cnf file contain?
    – Raihan
    Jan 4 '12 at 17:10
  • @Raihan: actually its a file like my.cnf but having different values. Jan 5 '12 at 4:30

It may be possible that both instances of MySQL are trying to record log entries to the same location (same file).

I do not think mysql allows more that one error log per MySQL instance.

Here is something further on using error log with mysqld and mysqld_safe:

No error log renaming occurs when the logs are flushed in any case if the server is not writing to a named file.

If you use mysqld_safe to start mysqld, mysqld_safe arranges for mysqld to write error messages to a log file or (as of MySQL 5.1.20) to syslog:

• Before 5.1.20, mysqld_safe behavior is to log to a file, using the default error log file if the --log-error option is not given to mysqld_safe. Otherwise, mysqld_safe uses the file name specified using --log-error=file_name.

• From 5.1.20 on, mysqld_safe has two additional error-logging options, --syslog and --skip-syslog.

In 5.1.21 and up, the default with no logging options is --skip-syslog, which is compatible with the default behavior of writing an error log file for releases prior to 5.1.20. To explicitly specify use of an error log file, specify --log-error=file_name to mysqld_safe, and mysqld_safe will arrange for mysqld to write messages to a log file. To use syslog instead, specify the --syslog option.

In 5.1.20 only, the following conditions apply: 1) The default is to use syslog, which is not compatible with releases prior to 5.1.20. 2) Logging to syslog may fail to operate correctly in some cases; if so, use --skip-syslog or --log-error.

For logging to syslog, messages from mysqld_safe and mysqld are written with a tag of mysqld_safe and mysqld, respectively. As of MySQL 5.1.21, to specify a suffix for the tag, use --syslog-tag=tag, which modifies the tags to be mysqld_safe-tag and mysqld-tag.

If you specify --log-error in an option file in a section that mysqld reads, mysqld_safe also will find and use the option.

Since you started mysqld_safe to start mysqld, you just need to start mysqld_safe and explicitly choose a separate file for the error of the other MySQL Instance using the --log-error option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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