<p>The server blocks a command that tries to turn off binary logging, which is mandatory for replication and point-in-time recovery.</p>
<p>MySQL Error 1518: ER_NO_BINLOG_ERROR appears when a statement attempts to disable binary logging with sql_log_bin = 0 in an environment where logging is required. Re-run the command without suppressing the binlog or execute it on a session not involved in replication to resolve the problem.</p>
It is not allowed to shut off binlog on this command
The exact message reads: "It is not allowed to shut off binlog on this command". MySQL raises it when a statement is executed with binary logging disabled through sql_log_bin = 0 or the NO_LOG_BIN modifier while the operation must be recorded in the binary log.
Binary logging drives replication, PITR, and audit trails. Blocking the attempt protects data consistency across replicas and backups, so resolving the error quickly is critical for production clusters.
MySQL detects that sql_log_bin is OFF for the current session or statement, yet the command being executed alters data that must be captured in the binary log. This mismatch triggers Error 1518 to enforce durability guarantees.
The error also surfaces when a user without the SUPER or SESSION_VARIABLES_ADMIN privilege tries to toggle sql_log_bin. Privilege checks ensure only trusted accounts can affect replication safety.
Re-issue the DML or DDL without disabling logging. Simply removing SET sql_log_bin = 0 or the SQL modifier NO_LOG_BIN allows the statement to execute and be written to the binary log.
If you must run non-logged maintenance, switch the server to read-only, stop replication, or direct the command to a standalone replica where binary logging can be safely disabled.
Dump restores that include 'SET sql_log_bin = 0' fail on replication masters. Remove the line from the dump or import on a replica instead.
CREATE TABLE ... SELECT with NO_LOG_BIN is rejected. Drop the modifier or execute the statement on a staging server, then replicate via standard channels.
LOAD DATA INFILE with binlog disabled causes Error 1518. Use LOAD DATA ... LOCAL or keep logging on and rely on replica parallelism for speed.
Never disable binary logging on a primary node. Use session-level variables only on isolated replicas or maintenance windows. Grant SUPER carefully and audit changes to sql_log_bin.
Galaxy’s versioned SQL editor highlights session variables, making accidental SET sql_log_bin = 0 easy to spot during code review, preventing the error before deployment.
Error 1238 (ER_BINLOG_FORMAT_MIXED) warns of unsafe statements under MIXED binlog format. Switch to ROW or avoid nondeterministic functions to fix it.
Error 1099 (ER_CANT_LOCK) occurs when FLUSH TABLES WITH READ LOCK fails during binlog rotation. Resolve lock contention or reduce long-running transactions.
Running SET sql_log_bin = 0 before a data-changing statement forces MySQL to raise Error 1518 when logging is mandatory.
Specifying NO_LOG_BIN on CREATE TABLE, INSERT SELECT, or LOAD DATA commands directly conflicts with the server’s replication rules.
Accounts lacking SUPER or SESSION_VARIABLES_ADMIN cannot change sql_log_bin, so any attempt results in Error 1518.
Triggered when an unsafe statement runs under MIXED binlog format. Fix by switching to ROW or rewriting the query.
Occurs when a nondeterministic function is used with STATEMENT logging. Change to ROW or remove the function.
Raised when PURGE BINARY LOGS would break replication. Verify replica positions before purging.
Yes, as long as the replica will not feed other replicas and you accept that its changes will not propagate further.
From MySQL 8.0.26 onward, SESSION_VARIABLES_ADMIN is also accepted, but most deployments still grant SUPER for this action.
mysqldump adds it to speed up imports. Remove or comment the line when loading into a master to avoid Error 1518.
Galaxy’s code linting flags any statement that toggles sql_log_bin and prompts a review, reducing the chance of replication-breaking mistakes.