How to Fix MySQL Error 3867 (ER_CLONE_CHARSET)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get mysql error 3867 when a clone donor uses a collation the recipient lacks. Fix this issue by installing the missing character set rules on the recipient server first. MySQL uses a built-in plugin to copy data from one server to another. The source server is the donor, and the target server is the recipient. Both servers must share the exact same character sets and sorting rules. If the recipient lacks a donor collation, the engine stops the copy right away. It throws the ER_CLONE_CHARSET

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 3867 when a clone donor uses a collation the recipient lacks. Fix this issue by installing the missing character set rules on the recipient server first.

MySQL uses a built-in plugin to copy data from one server to another. The source server is the donor, and the target server is the recipient. Both servers must share the exact same character sets and sorting rules. If the recipient lacks a donor collation, the engine stops the copy right away. It throws the ER_CLONE_CHARSET symbol with SQLSTATE HY000 to protect your data.

What causes mysql error 3867 in your database

The database engine checks server compatibility before it transfers any data pages. It reads every character set and collation active on the donor instance. Then it compares that list against the recipient server catalog. The message says the clone donor collation is unavailable in the recipient.

This mismatch often happens when teams define custom collations in local server files. A database admin might add a custom sorting rule to the donor server. Later, another team member provisions a fresh recipient node using standard base images. The new node lacks the custom definition file on its local disk. When the clone job starts, the pre-check fails before copying data.

Differences in system packages or build options also trigger this specific failure. One server might include extra character set files that the other server skipped. The clone plugin demands a strict match between both nodes to prevent index corruption. Without matching collations, the recipient cannot read or sort the incoming index trees.

How to find the missing collation and fix the recipient

Start by reading the exact error message in your database log. The message prints the exact name of the missing donor collation. Write down this collation name so you can check both database nodes.

Next, log in to the donor server with a read-only diagnostic role. Check the character set catalog to see where this collation lives. Determine if it comes from a custom XML file or a standard package. You do not need high privileges to inspect available character sets and collations.

MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Once you find the source file on the donor, check the recipient host. Copy the missing character set definition file to the recipient share folder. Make sure the file permissions match the rest of the database directory. Then restart the recipient database service so it loads the new collation rules.

After the restart, log in to the recipient and check the collation list. Confirm the missing collation now appears as available in the system catalog. You can now run the clone operation again without changing donor data.

How to prevent collation mismatches across database clusters

Manual file changes on single database nodes always create drift over time. Store all custom character set files in your central code repo instead. Use your deployment tool to push these files to every new database host.

You should also restrict who can run clone tasks in production. Grant clone permissions only to specific admin roles during planned maintenance windows. Keep audit logs of every admin query to track schema and system checks. If engineers query user tables during checks, apply data masking to rewrite emails and phone numbers.

Run automated pre-flight checks before you start a cluster clone job. A simple script can compare collation lists between the donor and recipient nodes. Catching a missing file early saves hours of failed maintenance work.

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

Does mysql error 3867 harm data on the donor server?

No, the clone check fails before the engine alters or copies any data. Your donor database stays safe and keeps serving traffic as normal.

Can I skip the collation check during a MySQL clone operation?

No, MySQL enforces this check to stop index corruption on the target node. You must add the missing collation to the recipient or drop it from the donor.

Where do custom collations live on a MySQL server?

Custom collations usually sit in the character set directory on the host disk. Check your server variables with a read role to find the exact folder path.

The query runs. The emails stay hidden.