Common SQL Errors

MySQL Error 1379: ER_LOG_PURGE_UNKNOWN_ERR - How to Fix and Prevent

Galaxy Team
August 6, 2025

<p>MySQL throws error 1379 when an unknown problem stops the server from deleting old binary or relay log files.</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 1379 ER_LOG_PURGE_UNKNOWN_ERR?

<p>MySQL Error 1379 ER_LOG_PURGE_UNKNOWN_ERR happens when the server cannot remove a binary log during PURGE BINARY LOGS. Check file permissions, stop replication threads, then purge the log again to resolve the issue.</p>

Error Highlights

Typical Error Message

Unknown error during log purge

Error Type

Operational Error

Language

MySQL

Symbol

ER_LOG_PURGE_UNKNOWN_ERR

Error Code

1379

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 1379: ER_LOG_PURGE_UNKNOWN_ERR?

Error 1379 (SQLSTATE HY000) occurs when MySQL tries to delete a binary or relay log file and receives an unrecognized return code from the operating system or storage engine. The server reports "Unknown error during log purge" and aborts the purge operation.

The failure usually appears during PURGE BINARY LOGS, RESET MASTER, or the automatic purge driven by expire_logs_days or binlog_expire_logs_seconds. Replication can stall and disk space may keep shrinking until the purge succeeds.

What Causes This Error?

File system anomalies often block log removal. Missing files, permission mismatches, or locks held by antivirus or backup agents can generate an unknown OS error that bubbles up as 1379.

Replication threads reading the target log, a crashed I/O thread, or InnoDB corruption may also stop the purge and trigger the generic error code.

How to Fix MySQL Error 1379

First, inspect the MySQL error log to capture the underlying OS error number. Then confirm the binary log file exists and has correct ownership. Stop replication threads with STOP SLAVE or STOP REPLICA before retrying PURGE BINARY LOGS.

If the file is locked externally, pause the backup or antivirus service. On corrupted logs, copy them aside, run RESET MASTER, and restart MySQL.

Common Scenarios and Solutions

On Linux, wrong SELinux labels often block file deletion. Relabel the datadir or disable SELinux enforcement temporarily, then purge again.

On Windows, open file handles from mysqldump or mysqlbinlog keep the log busy. Close those programs or reboot the host to release the handle.

Best Practices to Avoid This Error

Enable automatic expiration with binlog_expire_logs_seconds so purges happen regularly while the log is still fresh and less likely to be locked.

Maintain ample disk space, monitor replication lag, and ensure backup tools use --lock-binlog or --read-from-remote-master to avoid holding file locks.

Related Errors and Solutions

Error 1380 ER_LOG_PURGE_NO_FILE refers to a missing binary log during purge. Error 1092 ER_BINLOG_PURGE_PROHIBITED appears when binlog purging is disabled. Each requires different checks but follows similar troubleshooting steps.

Common Causes

File Permission Problems

The mysqld user lacks delete rights on the datadir, causing the OS to refuse the unlink request.

Active Replication Threads

Slave SQL or I/O threads still reading the log prevent its removal and raise the unknown purge error.

External File Locks

Backup utilities, antivirus software, or manual tail commands can keep a handle on the binary log, blocking deletion.

Corrupted File System

Disk errors or an unclean shutdown may corrupt directory metadata and make the log unreachable to DELETE calls.

Related Errors

MySQL Error 1380 ER_LOG_PURGE_NO_FILE

The specified binary log does not exist, often due to typo or earlier deletion.

MySQL Error 1092 ER_BINLOG_PURGE_PROHIBITED

Purge operation denied because binlog deletion is disabled via gtid_mode or server settings.

MySQL Error 1378 ER_LOG_PURGE_NO_PERMISSION

Purge failed due to insufficient file permissions rather than an unknown OS error.

FAQs

Does Error 1379 affect data integrity?

No user data is lost, but disk usage grows and replication may lag until the purge succeeds.

Can I ignore the error and keep running?

Ignoring the error risks running out of disk space, which can crash the server. Always resolve promptly.

Will RESET MASTER remove the error?

RESET MASTER clears all binary logs and removes the blockage, but you lose point-in-time recovery; use only after a full backup.

How does Galaxy help prevent this error?

Galaxy tracks purge commands in versioned SQL, highlights failed runs, and suggests permission fixes via its AI copilot, reducing human error.

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