Free tools Windows power users keep installed
One-click scans. No signup required.
The message Can't log to error log and syslog at the same time. means MySQL has been given two mutually exclusive logging destinations. One setting selects an error-log file with --log-error; another selects the system logger with --syslog. Remove one destination, restart MySQL through its normal service manager, and verify the destination you kept.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What the conflict means
When mysqld_safe starts mysqld, it coordinates error and notice messages from both processes. A file destination and a syslog destination cannot be active simultaneously for that startup path. If the effective options contain both log-error=/path/to/error.log and syslog, startup stops with the conflict message recorded in MySQL Bug #72598: Can't log to error log and syslog at the same time.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
This is a configuration collision, not evidence that the error-log file is damaged or that syslog itself is unavailable. Pick the destination that matches your operating model and remove every setting that selects the other one.
File logging and syslog compared
| Decision point | Error-log file | System logger |
|---|---|---|
| Destination | A file selected by log-error, or the default host_name.err file in the data directory |
The operating system’s syslog facility or, commonly under systemd, the journal |
| Configuration owner | mysqld_safe and/or the server option file, depending on the startup path |
Prefer MySQL server-native system-log support; legacy mysqld_safe switches are deprecated |
| Operational visibility | Inspect with tools such as tail or a log-management agent that reads files |
Inspect with the platform’s journal or syslog tools, such as journalctl on systemd systems |
| Rotation and retention | You must arrange suitable rotation, ownership, retention, and disk-space monitoring | The system logging stack normally provides its own routing, rotation, and retention policy |
| Systemd compatibility | Possible when the service deliberately starts mysqld_safe; not automatically applicable to a unit that starts mysqld directly |
Best aligned with a systemd-managed service when the server’s native logging and the unit’s journal integration are configured |
Identify how MySQL is being started
Do this before editing an option file. The correct fix depends on whether a wrapper script is actually running.
#1 Best Overall
Check the service unit
- Find the service name used by the host, for example
mysqlormysqld, with your distribution’s service listing. - Inspect its state and command definition:
systemctl status mysqlandsystemctl cat mysql(substitute the actual unit name). - Look for an
ExecStartcommand containingmysqld_safe. If the unit startsmysqlddirectly, the wrapper’s options are not the service’s primary configuration path.
Check the running command line
After a successful start, inspect the process list and command line for mysqld_safe, mysqld, --syslog, and --log-error. A process command line can reveal a service override or generated argument that is not obvious in the option files. If the server fails before staying up, use the service manager’s status output and boot journal to inspect the attempted command.
Why this distinction matters
Some modern packages do not install mysqld_safe at all. MySQL documents that [mysqld_safe] and the older [safe_mysqld] option-file sections are unsupported, or may behave unexpectedly, when systemd controls startup. In that situation, change the unit and the server’s own logging configuration rather than trying to repair a wrapper that is not in the execution path.
Find every setting that selects a destination
The conflict often persists because one option is in a global file while another is supplied by a service override or command line. Search all files included by your installation, including distribution-specific directories, and inspect the effective service definition.
- Search option files for the three relevant names:
syslog,skip-syslog, andlog-error. Include both option groups and any included files. - Check systemd drop-ins and generated service arguments with
systemctl cat <unit>. An override can append--syslogeven when the main option file does not. - Inspect the process command line when possible. Command-line options can override values read earlier from files.
- Write down every occurrence before changing anything. Your final configuration must select one destination only.
Do not assume that deleting one line is sufficient if an included file or service override still supplies the opposite setting. Keep comments that explain the chosen destination, but remove active duplicate directives.
Rank #2
Fix the configuration for an error-log file
Choose the file destination
Set log-error=/path/to/error.log in the option group read by the server or by the wrapper that really starts it. If you do not specify a path, MySQL’s default is a host_name.err file in the data directory. The explicit path is usually easier to monitor, but it must be writable by the account running MySQL and have enough free space.
Disable syslog explicitly
Remove --syslog wherever it appears. You can also use --skip-syslog as the explicit switch that suppresses syslog. The current MySQL 8.4 manual states that --skip-syslog writes to the default error-log file, or to the file named by --log-error.
Restart and verify
- Restart with the same manager that normally owns the service, for example
systemctl restart <unit>. Do not launch a second manualmysqld_safeprocess while the service is managed by systemd. - Check the service result and the selected file. Use
tail -f /path/to/error.logwhile reproducing a harmless administrative action, or inspect the newest entries after startup. - Confirm the running command line no longer contains
--syslogand that the configured file is receiving new startup messages.
With no syslog destination selected, notices are sent to the selected destination and standard output, while errors are sent to the destination and standard error. A journal entry produced by the service manager does not prove that the MySQL error log is configured as a file; systemd may capture standard streams independently.
Fix the configuration for system logging
Remove the competing file destination
If the system logger is the intended destination, remove log-error from the wrapper configuration and remove any file destination added by a service override. Do not leave a file option in one included file while adding syslog in another: the two destinations recreate the same collision.
Use the server’s native system-log support
MySQL supports native error logging to syslog on Unix-like systems. Configure that support in the server’s own option group and let the operating system’s logging stack handle routing, retention, and access. The mysqld_safe --syslog and --skip-syslog controls are deprecated, so they are a poor foundation for a new deployment or a migration to a current release.
Verify the journal or syslog stream
- Restart through the service manager.
- Read the unit’s current-boot messages with
journalctl -u <unit> -bwhen systemd is in use, or use the host’s configured syslog reader. - Check that MySQL startup and error messages arrive in the expected facility or journal stream and that no old file is still being updated.
Do not treat an old error-log file as proof that file logging remains enabled; it may simply contain historical entries. Check timestamps and observe the destination during a fresh restart.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Systemd-specific startup pitfalls
A systemd unit can start mysqld directly, capture its standard output and error, and apply command-line arguments independently of traditional SysV scripts. In that arrangement:
mysqld_safemay be absent, unused, or deliberately bypassed.- Settings under
[mysqld_safe]or[safe_mysqld]may be ignored or produce unexpected behavior. - The unit file and its drop-ins, together with the server’s native option group, are the places to configure startup and logging.
- Changing a legacy wrapper file will not fix an argument injected by
ExecStartor a systemd override.
Use systemctl cat <unit> to see the complete unit and drop-ins. If an override must be changed, edit it with the service manager’s supported override mechanism, then reload unit definitions before restarting. Keep the logging decision in one documented place so a package update does not silently reintroduce a second destination.
Troubleshoot the common failure modes
The conflict returns after editing one file
Another option file, an included directory, an environment-generated argument, or a systemd drop-in still supplies --syslog or log-error. Repeat the search across every included file and inspect the complete unit definition and command line. Remove the duplicate rather than trying to make both switches coexist.
No error-log file appears after choosing file logging
Confirm that the path is the one actually read by the active server, that its parent directory exists, and that the MySQL service account can create or append the file. Also check whether the service starts mysqld directly; a [mysqld_safe] setting cannot control a wrapper that is not running. The default host_name.err location is the data directory, not necessarily the directory where an administrator expects logs.
Recommended Free Tools
The journal contains messages even though file logging was selected
systemd can collect standard output and standard error from any service. MySQL’s notices and errors may therefore appear in the journal while the configured error log also receives messages. Verify the file’s modification time and contents; journal visibility alone does not establish the selected MySQL destination.
Syslog is selected but the expected stream is empty
Check that the native server syslog configuration is in the server’s option group, that the host’s syslog or journal service is running, and that its routing rules accept the facility used by MySQL. Inspect the service startup output for permission or configuration errors. If the unit is systemd-managed, read the unit journal as well as any traditional syslog file.
Best Value
The service will not restart after the change
Read the first startup error from systemctl status <unit> and journalctl -u <unit> -b, or the equivalent service-manager diagnostics. Check for a misspelled option, an inaccessible log path, an invalid override, or a still-present pair of destination settings. Restore the last known-good single destination, then make one change at a time.
What changed in MySQL 8.4 and later configuration practice
The current MySQL 8.4 documentation says that when none of the syslog destination options is supplied, the default is --skip-syslog. That default favors file logging rather than silently enabling the system logger. It does not, however, cancel an explicit --syslog supplied elsewhere, nor does it resolve a simultaneous log-error setting.
The same documentation deprecates controlling MySQL logging from mysqld_safe and directs administrators toward the server’s native syslog support. For a new configuration, first decide whether files or the system logger fit your monitoring, rotation, access-control, and retention requirements; then implement that choice in the component that actually starts the server.
Quick Recap
A safe final checklist
- Identify whether the service starts
mysqld_safeormysqlddirectly. - Search every option file, included directory, command line, and service override for
syslog,skip-syslog, andlog-error. - Select exactly one destination: an error-log file or the system logger.
- For file logging, remove
--syslog, optionally set--skip-syslog, and verify the file path and permissions. - For system logging, remove the competing file destination and configure native server syslog support rather than relying on deprecated wrapper switches.
- Restart through the normal service manager.
- Verify the chosen destination directly, using the error file or the journal/syslog reader, and check fresh timestamps.
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.




