Illegal mix of collations
“Illegal mix of collations” WordPress database error: causes and what to check
# 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
References
- Migrating WordPress (Advanced Administration Handbook)
- 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.
- Initial assessment: Site URL entry
- Copy to the recovery station: Work on a copy
- Diagnosis: Item-by-item checks
- Recovery and verification: Home and inner pages
- 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 →