Common SQL Errors

MySQL Error 1381: ER_NO_BINARY_LOGGING - How to Fix and Prevent

Galaxy Team
August 6, 2025

<p>MySQL throws ER_NO_BINARY_LOGGING (error 1381) when a statement that depends on the binary log is executed on a server where binary logging is disabled.</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 code 1381?

<p>MySQL Error 1381: ER_NO_BINARY_LOGGING appears when you run a binlog-dependent command on a server that was started without the log_bin option. Enable binary logging in my.cnf or via the RDS parameter group, then restart the instance to resolve the issue.</p>

Error Highlights

Typical Error Message

You are not using binary logging

Error Type

Configuration Error

Language

MySQL

Symbol

ER_NO_BINARY_LOGGING

Error Code

1381

SQL State

HY000

Explanation

Table of Contents

What is MySQL error code 1381?

Error 1381 carries the message You are not using binary logging. It means the MySQL server was started without the log_bin option, yet you executed a command that expects binary logging to be active.

The error is common in replication, point-in-time recovery, and audit scenarios, because those workflows depend on the binary log for change capture.

When does ER_NO_BINARY_LOGGING occur?

The server raises 1381 whenever you call statements like SHOW BINARY LOGS, SHOW BINLOG EVENTS, RESET MASTER, or FLUSH BINARY LOGS while binary logging is disabled.

It also triggers when stored procedures or triggers that need to write to the binlog execute on a non-logged server.

Why is fixing it important?

Binary logging underpins replication and point-in-time backups. If it is off, replicas cannot sync and PITR is impossible, risking data loss and downtime.

What Causes This Error?

Primary cause is the MySQL instance starting with --skip-log-bin or lacking the log_bin directive in my.cnf.

Cloud services such as Amazon RDS or Azure Database may have parameter groups where binlog_format or log_bin is disabled, producing the same error.

How to Fix MySQL Error 1381 ER_NO_BINARY_LOGGING

Add log_bin, server_id, and a unique log file base name to your my.cnf, then restart MySQL.

In managed services, modify the parameter group to enable binary logging and apply a reboot.

Common Scenarios and Solutions

Local development servers often skip binary logging for performance. Enable it only on staging and production, or wrap replication commands in IF clauses to avoid errors.

During logical backups, mysqldump --master-data needs the binlog. Run mysqldump without that flag or turn binary logging on.

Best Practices to Avoid This Error

Automate configuration management so every production instance has log_bin enabled and validated at boot time.

Use monitoring to alert when the variable log_bin is OFF so the team can respond before replication breaks.

Related Errors and Solutions

Error 1220 ER_BINLOG_DISABLED is similar but appears when you attempt to change binlog_format on a server without logging. Enabling log_bin resolves both.

Error 1593 ER_SLAVE_CONFIGURATION prevents a replica from starting if the source lacks binary logging; again the fix is enabling log_bin and restarting.

Common Causes

Server started with --skip-log-bin

The skip flag disables all binary logging, immediately triggering error 1381 for any binlog call.

Missing log_bin directive in my.cnf

If my.cnf lacks log_bin, the server runs silently without logging and raises the error on demand.

Managed service parameter group disables log_bin

Cloud databases can override your settings; a disabled flag in the parameter group causes the same error.

Attempting replication commands on a read-replica

Some replicas are configured without logging to save space; issuing RESET MASTER on them fires 1381.

Related Errors

MySQL Error 1220 ER_BINLOG_DISABLED

Triggered when you change binlog_format while binary logging is off.

MySQL Error 1593 ER_SLAVE_CONFIGURATION

Occurs when a replica expects binary logs but the source has them disabled.

MySQL Error 1872 ER_BDC_LOGGING_IMPOSSIBLE

Appears when trying to turn on log retention features without active binlogging.

FAQs

Does enabling binary logging hurt performance?

Binary logging adds minimal overhead on modern storage. The safety benefits outweigh the cost for most workloads.

Can I enable log_bin without a restart?

No. log_bin is a static variable. You must modify my.cnf or the parameter group and reboot.

Do I need binary logging on replicas?

Not strictly, but enabling it improves disaster recovery and allows chained replication.

How does Galaxy help with this error?

Galaxy highlights server variables in its schema panel, alerting you when log_bin is OFF so you can act before running replication 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