How to Fix MySQL Error 1224 (ER_MIXING_NOT_ALLOWED)
You see mysql error 1224 when a transaction touches transactional and non-transactional tables together. You fix this error by separating those table writes or converting all tables to the same storage engine. MySQL logs this problem under the symbol ER_MIXING_NOT_ALLOWED and SQLSTATE HY000. The message says that mixing of transactional and non-transactional tables is disabled. When a query fails with this code, the database stops the command to protect data accuracy. What causes mysql error
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You see mysql error 1224 when a transaction touches transactional and non-transactional tables together. You fix this error by separating those table writes or converting all tables to the same storage engine.
MySQL logs this problem under the symbol ER_MIXING_NOT_ALLOWED and SQLSTATE HY000. The message says that mixing of transactional and non-transactional tables is disabled. When a query fails with this code, the database stops the command to protect data accuracy.
What causes mysql error 1224 in the database
MySQL supports several storage engines that handle data writes in different ways. Transactional engines let you group changes and roll them back if an error happens. Non-transactional engines write changes to disk right away and cannot undo them.
When one transaction writes to both engine types, the database faces a hard choice. If the query fails halfway through, the transactional table can undo its work. The non-transactional table keeps the new data because it lacks a rollback log.
This split state breaks data safety and makes replicas drift out of sync. Replication logs need clear boundaries to replay events on secondary nodes in the right order. When an engine forbids mixed writes, it blocks the query and returns mysql error 1224.
Legacy apps often hit this wall during database upgrades or schema changes. A team might add a new transactional table that joins an older report table. Triggers and stored routines can also hide mixed writes across different table types.
How to find the mixed tables in your queries
Start by finding the exact query that threw the error in your app logs. Look at every table name that appears in that failed statement. Check the table metadata in the system catalog to see which storage engine each one uses.
Do not stop at the tables named in the main query text. Inspect all triggers that run when those tables receive an insert, update, or delete. A trigger on a transactional table might write an audit row into a non-transactional table.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You can inspect this schema data using a read-only database role. Never grant admin rights to developers just to check table engine types in production. Keep diagnostic sessions limited to metadata views so nobody changes live settings by mistake.
How to fix the error safely in production
You have two clean ways to resolve ER_MIXING_NOT_ALLOWED without risking data loss. The best long-term fix is to convert the non-transactional tables to a transactional engine. This change brings all your tables under the same rollback and recovery rules.
Before you convert a live table, test the change on a staging copy. Check how long the table rebuild takes and look for full-text index limits. Schedule the production change during a quiet window so locks do not block user traffic.
If you cannot change the table engine, you must split the transaction in your app. Run the transactional queries first and commit that work to the database. Then run the write to the non-transactional table as a separate statement outside the transaction block.
If a trigger caused the mixed write, move that logging logic into the app code. You can also change the audit log table to use the transactional engine. Never turn off safety checks on the server just to force a mixed query through.
When your team runs schema fixes in production, control how they reach the database. Require peer review for any query that alters table engines on live hosts. Mask sensitive columns like emails, phone numbers, and card numbers so query results rewrite matched fields.
Check MySQL queries and results on the wire
MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.
Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.
Frequently asked questions
What does SQLSTATE HY000 mean with error 1224?
SQLSTATE HY000 is a general error code for server rules that lack a specific standard class. You must read the database error code 1224 and symbol ER_MIXING_NOT_ALLOWED to find the exact cause.
Can a read query trigger mysql error 1224?
Plain read queries rarely trigger this error on their own. The failure usually happens when a transaction modifies data across both table types or locks them for updates.
Why should we avoid disabling engine mixing checks?
Allowing mixed writes means a rollback will leave partial data in non-transactional tables. This partial write corrupts business logic and breaks replication on backup database nodes.
Related guides
In this post