Initial assessment

Illegal mix of collations

“Illegal mix of collations” WordPress database error: causes and what to check

Updated 2026-11-01
# Common log entries
WordPress database error Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '='

MySQL and MariaDB return this error when one query compares or joins text columns that use different collations, for example utf8mb4_unicode_ci and utf8mb4_unicode_520_ci. In WordPress it usually follows a migration or a partial import, when some tables were created with a different default than the rest.

Which of these do you see?

A query joins a table that was created with another collation.

Tables created on the new server use its default collation, while imported tables keep the old one.

The plugin created its tables with a collation that differs from the WordPress tables it joins.

Common causes

Mixed table collations: Some tables or columns use one collation and others use another.
Different server defaults: The old and new database servers have different default collations.
Partial import: Only some tables were exported and imported again.
Plugin tables: A plugin created tables without matching the WordPress collation.

References

  1. Migrating WordPress (Advanced Administration Handbook)
  2. Debugging in WordPress (Advanced Administration Handbook)

Rather not fix it yourself? Let WP119 handle it automatically.

Mismatched table collations are handled automatically: the system converts the incompatible collations and lists the table names in the report. Fixes are made on a copy of your site in the recovery station and written back only after re-verification passes. In your site’s database, the protected tables (members, comments, orders and form submissions) are copied as structure only. In SSH and FTP mode, the system creates a pre-recovery backup on your host before writing back and restores from it if verification after write-back fails. If the recovery cannot be completed, the recovery fee is refunded in full.

  1. Initial assessment: Site URL entry
  2. Copy to the recovery station: Work on a copy
  3. Diagnosis: Item-by-item checks
  4. Recovery and verification: Home and inner pages
  5. Write-back or delivery: Only after verification passes

Use WP119 when pages or searches fail with this database error after a migration or an import.

Check my site →
Initial assessment →