1625
MySQLWARNINGNotableReplicationHIGH confidence
Message and statement are both unsafe for replication
Production Risk
Medium — multiple unsafe conditions compound replication risk.
What this means
Both the statement and an associated message indicate unsafe replication conditions. This warning appears when multiple unsafe conditions are detected for the same statement.
Why it happens
- 1The statement triggers more than one unsafe replication condition simultaneously.
- 2A combination of non-deterministic functions, system variables, and engine mixing.
How to reproduce
trigger — this will error
trigger — this will error
INSERT INTO t SELECT UUID(), @@hostname FROM myisam_src;
expected output
Warning 1625: Unsafe statement written to the binary log.
Fix
Switch to ROW binlog format to cover all unsafe cases
Switch to ROW binlog format to cover all unsafe cases
SET SESSION binlog_format = 'ROW';
Why this works
ROW format records exact row data, eliminating all statement-level non-determinism.
Sources
Official documentation ↗
MySQL 8.0 — 1625 ER_MESSAGE_AND_STATEMENT_UNSAFE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev