1197: Multi-statement transaction required more than 'max_binlog_cache_size'
MySQLWhat does it mean?
The binlog data generated by a single transaction exceeded the memory/cache limit defined by max_binlog_cache_size. The transaction did not fit into the binary log, so it failed and was rolled back.
Why does it happen?
A very large transaction (a single INSERT/UPDATE/DELETE of millions of rows or a huge bulk load) filled the binlog cache. With binary logging enabled (replication/point-in-time recovery), large transactions can easily exceed this limit.
How to fix it
Split the large transaction into smaller batches; COMMIT after each batch. If truly large transactions are unavoidable, increase max_binlog_cache_size (and binlog_cache_size if needed). In ETL/bulk loads, a chunked load with intermediate COMMITs prevents both this error and long-held locks.
More from this engine
- 1055Expression not in GROUP BY (only_full_group_by)
- 1267Illegal mix of collations
- 1030Got error N from storage engine
- 1785Statement violates GTID consistency
- 3024Query execution was interrupted, maximum statement execution time exceeded
- 1298Unknown or incorrect time zone
- 1418Function has none of DETERMINISTIC, NO SQL, or READS SQL DATA (binary logging enabled)