Common SQL Errors

MySQL Error 3006: ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN - How to Fix and Prevent

Galaxy Team
August 8, 2025

MySQL marks a statement unsafe for statement-based replication because it uses a fulltext parser plugin that may produce different results on replicas.

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 3006 (ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN)?

ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN appears when MySQL deems a statement unsafe for statement-based replication due to a fulltext parser plugin that may act differently on replicas. Switch the source to ROW logging, install identical plugins on every node, or avoid the custom parser to resolve the error.

Error Highlights

Typical Error Message

ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN

Error Type

Replication Error

Language

MySQL

Symbol

plugin which may not return the same value on the slave. ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN was added in 5.7.1.

Error Code

3006

SQL State

HY000

Explanation

Table of Contents

What is MySQL Error 3006 (ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN)?

The error appears when a DML statement that triggers a fulltext parser plugin is written to the binary log in STATEMENT format. MySQL labels the statement unsafe because the custom parser might return different tokenization results on replicas, leading to data divergence. The server therefore stops and returns Error 3006 instead of logging the query.

Replication safety matters because statement-based logging relies on deterministic results to keep master and replica tables identical. When determinism cannot be guaranteed, you must change logging strategy or remove the non-deterministic element.

What Causes This Error?

The error is triggered only when binlog_format is set to STATEMENT or MIXED, and the executed statement uses MATCH...AGAINST or ALTER TABLE ... ADD FULLTEXT that relies on a user-installed parser plugin. Built-in MySQL fulltext parsing does not raise the error; only custom plugins flagged as unsafe do.

If the same plugin is not installed or compiled differently on replicas, the output can change. MySQL pre-emptively blocks the log entry to prevent silent inconsistency.

How to Fix ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN

Fastest solution is to switch the source server to ROW based replication, where actual row images are logged and plugin behavior no longer matters. You can toggle it session-wide for one statement or globally.

Another fix is to install and configure the identical fulltext parser plugin on every replica so that the statement becomes deterministic. Finally, you can rewrite or avoid fulltext operations in the offending transaction if replication format cannot change.

Common Scenarios and Solutions

A migration script adds a FULLTEXT index using a Chinese word-segmentation plugin with binlog_format=STATEMENT - switch to ROW first, run the DDL, then revert if desired.

An ETL job updates a table with MATCH...AGAINST using a custom parser - wrap the job in SET SESSION binlog_format='ROW' before executing, or run it on a replica not used as a replication master.

Best Practices to Avoid This Error

Default to ROW or MIXED with ROW fallback in modern MySQL versions. Keep plugin binaries identical and version-locked across all nodes using configuration management. Incorporate replica readiness checks that test SHOW PLUGINS before promoting a server to master.

Use Galaxy's query endorsement to document required session variables for any script that depends on custom fulltext parsing, ensuring teammates run the statement safely every time.

Related Errors and Solutions

Error 1592 (ER_BINLOG_UNSAFE_STATEMENT) occurs when non-deterministic functions are used under STATEMENT format. The remedy is the same: switch to ROW or eliminate the non-determinism.

Error 3176 (ER_BINLOG_UNSAFE_SKIP_LOCKED) warns about SKIP LOCKED with statement logging. Consistent strategy of ROW logging and plugin parity protects against all such replication safety errors.

Common Causes

Custom fulltext parser plugin not present on replicas

When the parser library exists only on the source, MySQL cannot guarantee identical tokenization on replicas and blocks the statement.

STATEMENT or MIXED logging modes

The error only rises when binlog_format is not ROW. In ROW mode, the plugin output is captured as row images, so safety checks are bypassed.

Version mismatch of the same plugin

Different plugin builds or configuration options across nodes lead to potentially divergent results, making the statement unsafe.

Upgrades from older MySQL versions

Migrations to 5.7.1+ introduce the safety check; legacy scripts that once worked may now fail until replication format is updated.

Related Errors

ER_BINLOG_UNSAFE_STATEMENT (1592)

Raised for general non-deterministic statements under STATEMENT logging.

ER_BINLOG_UNSAFE_SYSTEM_VARIABLE (1231)

Triggered when unsafe system variables change during a transaction.

ER_BINLOG_UNSAFE_SKIP_LOCKED (3176)

Shows when SELECT ... SKIP LOCKED runs under statement based replication.

FAQs

Can I ignore ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN?

Ignoring it risks data divergence; always address the root cause before retrying the statement.

Is ROW logging slower?

ROW format generates larger logs, but network and disk improvements usually offset the overhead. It is the safest mode.

Will disabling the plugin fix the error?

Yes. Reverting to built-in fulltext parsing removes the unsafe element and the statement will replicate safely.

How does Galaxy help?

Galaxy lets teams share endorsed queries that include SET statements, reducing accidental runs under STATEMENT mode and preventing this 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