Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Short answer: mysqld_safe is being given two mutually exclusive logging destinations: --log-error selects a file, while --syslog selects the system logger. Remove one. For a file, keep log-error=/path/to/error.log (or the default host_name.err) and add --skip-syslog if you want the choice to be explicit. For journald or syslog, remove the file destination and configure MySQL’s native system-log support. Then restart with the same service manager that normally starts MySQL and verify the destination you selected.

What the conflict message means

The message Can’t log to error log and syslog at the same time. is a destination collision, not an indication that the error-log file is corrupted. mysqld_safe must send its own notices and errors, together with messages it receives from mysqld, to one destination. The two switches below select different destinations:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Setting Destination selected Effect
--log-error=file_name An error-log file Messages are written to the specified path. If no path is supplied, MySQL can use the default host_name.err file in the data directory.
--syslog The operating system’s syslog facility Messages are handed to the system logger rather than a mysqld_safe error-log file.
--skip-syslog File logging Suppresses syslog and writes to the default error-log file or to the file named by --log-error.

MySQL Bug #72598 records this exact startup failure. The fix is to leave only one destination in the complete startup configuration. A setting in an included option file, a systemd drop-in, or a service command line can conflict with a setting you edited elsewhere.

First determine how MySQL is started

Do this before changing an option file. The correct fix depends on whether a wrapper called mysqld_safe launches the server or whether a service manager launches mysqld directly.

Check the service unit

On a systemd host, inspect the service and its drop-in files. The service may be named mysql.service or mysqld.service, depending on the package.

  1. Run systemctl status mysql. If that unit does not exist, try systemctl status mysqld.
  2. Display the complete unit, including drop-ins, with systemctl cat mysql.service (or the actual unit name).
  3. Read the ExecStart line. If it launches mysqld directly, mysqld_safe is not the component choosing the destination.

Confirm the running command line as well, for example with ps -ef | grep '[m]ysqld'. A package can install mysqld_safe even when the enabled service never uses it.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the distinction matters

With systemd packaging, mysqld_safe may be unnecessary, absent, or bypassed. The MySQL 8.4 documentation warns that [mysqld_safe] and [safe_mysqld] option-file sections are unsupported or can behave unexpectedly when systemd starts the server. In that arrangement, configure the systemd unit and mysqld’s own logging settings instead of trying to repair a mysqld_safe command that is not running.

Find every setting that chooses a destination

Search all option files, included directories, service overrides, and manually supplied arguments for the three relevant names: syslog, skip-syslog, and log-error. Do not stop after finding the first occurrence; an included file can override the file you normally edit.

Option files

Review the files used by your installation, such as /etc/my.cnf, /etc/mysql/my.cnf, and files in an included conf.d or my.cnf.d directory. A read-only search can help locate all occurrences:

grep -RniE '(^|[[:space:]])(syslog|skip-syslog|log-error)' /etc/my.cnf /etc/mysql /etc/my.cnf.d 2>/dev/null

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Also inspect the service’s ExecStart arguments and any systemd drop-in under /etc/systemd/system. A command-line --syslog can override an apparently correct file configuration.

Keep one destination

  • For file logging, remove --syslog and retain a single log-error value, or rely on the default error file. Add --skip-syslog when you want to make suppression of syslog explicit.
  • For system logging, remove the file destination that causes the collision and use MySQL’s native system-log support. Do not leave a second log-error setting in another option group or service argument.
  • Do not treat --skip-syslog and --syslog as complementary switches. They express opposite choices; the effective configuration must select one destination.

Fix the configuration for an error-log file

Choose this path when administrators need a conventional file for tailing, application-specific collection, or a file-rotation policy.

  1. In the option group used by the process that actually starts MySQL, remove --syslog.
  2. Set log-error=/path/to/error.log in the appropriate server option group if you need a fixed path. If you omit it, MySQL can use the default host_name.err file in the data directory.
  3. Use --skip-syslog as an explicit mysqld_safe switch when mysqld_safe is genuinely being used. The current MySQL 8.4 manual states that this switch suppresses syslog and selects the default error file or the file named by --log-error.
  4. Check that the directory exists and that the account running mysqld can create and write the file. A syntactically correct path still fails if its parent directory or permissions are wrong.
  5. Restart through the normal manager: for example, systemctl restart mysql or systemctl restart mysqld, using the unit that was active in the first step.
  6. Verify the result by opening the configured file or running tail -n 50 /path/to/error.log. Confirm that a new startup timestamp appears after the restart.

When mysqld_safe is used, it arranges for its own error and notice messages and mysqld’s messages to go to the same selected destination. File rotation, retention, permissions, and disk-space monitoring are therefore part of the file-logging administration work.

Fix the configuration for syslog or journald

Choose system logging when your operating system already centralizes service messages, applies a standard retention policy, or exposes them through a journal. The exact storage location is controlled by the system logger, not by a universal MySQL filename.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Remove the file destination that conflicts with syslog, including a log-error argument supplied by the mysqld_safe command or service unit.
  2. Use MySQL’s native system-log support in the server configuration. This is the forward-looking method in current MySQL documentation; the mysqld_safe --syslog and --skip-syslog controls are deprecated.
  3. Reload or restart using the same service manager that normally starts the server. If you changed a systemd unit or drop-in, run systemctl daemon-reload before the restart.
  4. Check the system destination. For a systemd unit, start with journalctl -u mysql.service -b or the actual unit name. On systems using a traditional syslog daemon, consult that daemon’s configured facility and destination files.

A journal entry does not prove that file logging is enabled. Services can send errors to stderr, and a service manager may capture that stream in the journal even when the selected MySQL destination is a file. Verify the configured destination directly.

File logging versus system logging

The choice is operational as well as syntactic. The following comparison uses the configuration ownership and maintenance responsibilities that matter when removing the conflict.

Consideration Error-log file Syslog or journald
Destination A path set by log-error, or the default host_name.err in the data directory The operating system’s logger, such as a journal or traditional syslog daemon
Configuration owner mysqld_safe when it is the launcher, plus mysqld’s log-error setting Prefer MySQL’s native server system-log support; mysqld_safe controls are legacy and deprecated
Operational visibility Direct file tools such as tail, file collectors, and editors Journal or syslog tools, filters, facilities, and service-unit views
Rotation and retention Must be planned for the selected file, its owner, disk usage, and rotation process Handled by the system logger’s rules and retention policy
Compatibility with systemd packaging Works when the active service starts a process configured for file logging; mysqld_safe sections may be ignored when systemd starts mysqld directly Fits a systemd-managed service when native server logging and the unit’s journal capture are configured consistently

Where the error log is when syslog is enabled

There may be no MySQL error-log file at all. With syslog selected, messages go to the system logger, whose final location depends on the operating system and its logging rules. On a systemd installation, query the MySQL unit’s journal, for example:

journalctl -u mysql.service --since today

If the service is named differently, substitute that unit name. On a host using rsyslog, syslog-ng, or another traditional daemon, inspect the daemon’s configured rules for the facility and destination used by MySQL. Do not assume that a familiar path such as a particular file under /var/log applies to every distribution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The MySQL 8.4 behavior is also important when diagnosing startup output: notices go to the selected destination and stdout, while errors go to the selected destination and stderr. A systemd journal can therefore contain stderr or stdout from a startup attempt even when the configured persistent destination is a file.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot the common failure branches

The same conflict appears after editing one file

The process is probably reading another option file or receiving a command-line override. Recheck every included directory, the complete output of systemctl cat, and any wrapper script. Search specifically for both spellings, syslog and skip-syslog, as well as every log-error entry. Restart only after removing the unwanted destination from the configuration path that actually launches MySQL.

The service starts, but no expected file is created

First confirm that the active process uses file logging rather than native syslog. Then check the exact log-error path, the data directory’s default host_name.err location, parent-directory permissions, and available disk space. If systemd starts mysqld directly, a [mysqld_safe] setting will not select the file.

The journal contains messages although file logging was selected

This can be normal for startup diagnostics because errors are also written to stderr and notices to stdout. Determine whether the configured error file is receiving new entries; do not infer the active destination from a journal line alone.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The file and syslog both appear to receive messages

Inspect whether one stream is merely captured by the service manager while the selected destination is elsewhere. Also look for two separate processes or two startup attempts. mysqld_safe’s rule is one destination for its managed messages; remove duplicate launchers and conflicting arguments before deciding that simultaneous persistent logging is configured.

A systemd service ignores mysqld_safe options

That indicates a startup-path mismatch rather than a malformed switch. Move the setting to the systemd unit or mysqld’s native logging configuration, then reload the unit and restart it. Do not rely on unsupported or unexpected [mysqld_safe] or [safe_mysqld] sections in a systemd-managed installation.

What changes in MySQL 8.4 and later administration

The current MySQL 8.4 manual makes three points that guide a durable fix:

  • If none of the destination options is supplied to mysqld_safe, the default is --skip-syslog, so file logging is the default behavior for that wrapper.
  • --syslog and --skip-syslog are deprecated mysqld_safe controls.
  • Controlling mysqld logging from mysqld_safe is deprecated; native server syslog support is the recommended direction.

For a legacy installation that still invokes mysqld_safe, selecting exactly one destination resolves the immediate startup error. For a systemd-managed or newly maintained installation, configure logging at the server and service-manager layers instead of building new dependencies on mysqld_safe.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Final verification checklist

  • Identify whether mysqld_safe is actually running or whether systemd launches mysqld directly.
  • Search all option files, include directories, service units, drop-ins, and command-line overrides.
  • Choose one destination: a file or the system logger.
  • For a file, remove --syslog, set log-error if needed, and use --skip-syslog explicitly when mysqld_safe is in use.
  • For syslog, remove the conflicting file destination and configure native server system logging.
  • Restart through the normal service manager and reload systemd configuration when a unit changed.
  • Verify the selected destination directly: inspect the error file, or query the journal/syslog facility.
  • Check ownership, permissions, rotation, retention, and disk space for whichever destination remains.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.