How to Fix MySQL Error 1804 (ER_MTS_RESET_WORKERS)
You get mysql error 1804 when a replica cannot clean up its worker info tables. You fix it by checking the error log, repairing system tables, and resetting the replica. This failure uses the symbol ER_MTS_RESET_WORKERS and returns the SQLSTATE value HY000. It happens on database replicas that use more than one thread to apply changes. When you try to reset the replica state, the engine tries to clear worker progress. If the storage engine blocks that write operation, the reset stops right away
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 get mysql error 1804 when a replica cannot clean up its worker info tables. You fix it by checking the error log, repairing system tables, and resetting the replica.
This failure uses the symbol ER_MTS_RESET_WORKERS and returns the SQLSTATE value HY000. It happens on database replicas that use more than one thread to apply changes. When you try to reset the replica state, the engine tries to clear worker progress. If the storage engine blocks that write operation, the reset stops right away. Understanding why the database cannot clear these internal records helps you restore replication fast.
What causes mysql error 1804 in multi-threaded replication
Multi-threaded replication splits incoming changes across several worker threads on the replica server. Each worker writes its current progress into an internal system table during normal work. This setup lets the database recover without losing data if a crash happens. When an admin resets the replica, the server must wipe those worker tables clean. If that cleanup fails, the server returns the message Cannot clean up worker info tables.
Several issues inside the database engine can block this cleanup step. The disk holding the system database might be full or set to read-only mode. A corrupt internal table or a stuck row lock can also stop the delete step. Sometimes an admin changes the table storage engine from transactional to non-transactional by mistake. The official message notes that additional error messages can be found in the MySQL error log.
How to diagnose and fix the failure in production
Start your fix by reading the server error log on the affected replica host. The log shows the exact storage or lock issue that blocked the worker table cleanup. Check your free disk space and verify that the file system allows write operations. Make sure no long queries or backup jobs hold locks on the internal system tables.
Once you find the root blocker, stop all active replication threads on the replica. If a transaction holds a lock on the worker tables, wait for it to finish. You can also end the blocking session if it is stuck. If the log points to table corruption, run a table repair or restore from backup.
MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
After the system tables are healthy and writable, run the replica reset command again. Do not grant broad superuser roles to standard app accounts to work around this error. Keep admin rights limited to designated database engineers during the repair process. Start the replication threads again and check the replica status to confirm normal data flow.
Preventing worker table issues in database clusters
You can avoid future worker cleanup errors with a few basic operational habits. Store your replica info and worker info in transactional tables rather than plain files. Monitor disk space on all replica nodes so logs and system tables never run out. Set alerts for replication lag and worker thread stops so your team catches issues early.
Test your failover and replica reset steps in a staging setup before production changes. Keep strict access rules on the internal system schema so users cannot lock those tables. When you manage admin sessions well, routine replica maintenance stays predictable and safe.
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 the ER_MTS_RESET_WORKERS symbol mean?
It means the multi-threaded replica failed to clear its internal worker progress tables during a reset. The database stops the reset so you do not end up with mismatched replication state.
Where can I find the exact cause of mysql error 1804?
Check the main MySQL error log file on the replica server right after the failure. The engine writes the underlying storage, lock, or corruption error there with a matching timestamp.
Does fixing this error require a full database restart?
Most cases do not need a full server restart if you clear the blocking lock or disk issue. You only need to restart the service if the storage engine is stuck in recovery mode.
Related guides
In this post