Common SQL Errors

MySQL Error 1573: ER_CANT_ACTIVATE_LOG - How to Fix and Prevent

Galaxy Team
August 7, 2025

<p>MySQL cannot activate the requested log file because of configuration, permission, or disk issues.</p>

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1573 (ER_CANT_ACTIVATE_LOG)?

<p>MySQL Error 1573: ER_CANT_ACTIVATE_LOG occurs when the server fails to turn on a log such as the general, slow, or binary log. Check file paths, permissions, and global variables, then restart logging with correct settings to resolve the issue.</p>

Error Highlights

Typical Error Message

Cannot activate '%s' log

Error Type

Configuration Error

Language

MySQL

Symbol

ER_CANT_ACTIVATE_LOG

Error Code

1573

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 1573 (ER_CANT_ACTIVATE_LOG)?

The server raises Error 1573 with the message Cannot activate '%s' log when it cannot start writing to a requested log file. The placeholder reveals which log type failed: general, slow, or binary log.

The failure happens during SET GLOBAL log_output or log_type statements, at server startup, or while changing replication roles. Understanding the root cause prevents data loss, auditing gaps, and replication outages.

What Causes This Error?

MySQL needs write access to the target log file and directory. Missing permissions or wrong ownership stop the server from opening the file, triggering the error.

An invalid path in my.cnf or SET GLOBAL commands also causes activation failure. If the path points to a full or read-only filesystem, MySQL cannot create or append the log.

When enabling binary logging on a server built without --log-bin or compiled without logging support, the server reports the same error.

How to Fix MySQL Error 1573

First confirm which log failed using the error log entry. Then verify that the configured path exists and the mysql user can write to it. Adjust file permissions to 660 and directory permissions to 770 as a starting point.

If the path is incorrect, update my.cnf or run SET GLOBAL general_log_file='valid_path' and SET GLOBAL general_log=ON. Restart logging with FLUSH LOGS to test.

For binary logs, set log_bin and server_id in my.cnf, ensure datadir has free space, and restart MySQL. Review the error log to confirm that binary log rotation starts normally.

Common Scenarios and Solutions

Changing general_log at runtime in macOS: fix by granting mysql ownership on /usr/local/var/mysql and toggling SET GLOBAL general_log.

Docker container with bind mount volume: mount with rw permissions and chown the directory to mysql: mysql before starting mysqld.

Enabling log_bin on AWS EC2 with limited disk: resize the volume or point log_bin to a larger disk, then restart.

Best Practices to Avoid This Error

Always define absolute paths for general_log_file, slow_query_log_file, and log_bin in my.cnf to avoid accidental directory changes.

Use chmod 660 and chown mysql:mysql on all log directories during configuration management runs. Verify with automated tests.

Monitor disk space and inode usage with tools like Prometheus node exporter. Alert at 80 percent capacity to avoid sudden log activation failures.

Related Errors and Solutions

Error 1595 ER_CANT_START_SLAVE: happens when binary logging is disabled on the master. Enable log_bin and restart.

Error 1231 ER_VARIABLE_IS_READONLY: occurs when trying to change log_bin dynamically. Set the option in my.cnf and restart.

Common Causes

Invalid File Path

The configured path for the log does not exist or points to a location outside the server's permissions.

Permission Denied

The mysql operating system user lacks write or execute permissions on the directory that should hold the log file.

Read-Only Filesystem

The target filesystem is mounted read-only because of maintenance or unexpected crashes, blocking log writes.

Insufficient Disk Space

No free space or inodes remain, so MySQL cannot create or extend the log file.

Logging Disabled at Compile Time

The server was built without the requested logging capability, making runtime activation impossible.

Related Errors

Error 1231 ER_VARIABLE_IS_READONLY

Raised when attempting to modify read-only logging variables at runtime. Fix by editing my.cnf and restarting.

Error 1595 ER_CANT_START_SLAVE

Occurs when the replication slave cannot start because the master lacks binary logs. Enable log_bin on the master to resolve.

Error 1220 ER_ERROR_LOG_WRITE_FAILED

Triggered when MySQL cannot write to its error log. Check permissions and disk space similarly.

FAQs

Can I enable binary logging without restarting MySQL?

No. log_bin is a read-only variable that requires setting in my.cnf and a server restart.

Does this error affect query processing?

The server continues to run, but auditing, slow query data, or replication may be incomplete until logging is restored.

Where is the failing log path recorded?

Review the MySQL error log. It shows the exact path and the system error code returned by the OS.

How does Galaxy help avoid this error?

Galaxy highlights server error messages in its integrated console and offers AI suggestions to verify log paths and permissions before you rerun SET GLOBAL commands.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo