MySQL ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='

Two strings with different collations were compared or joined.

Seen on: SQL

Meaning

Tables created at different times (or by different MySQL versions) have different default collations; joins on text columns then fail.

Common causes

  • Tables/columns with different collations
  • Connection collation differs from column collation
  • Mixing utf8 and utf8mb4

⚡ Quick fix

  1. Convert tables to one collation
  2. COLLATE explicitly in the query as a stopgap

Detailed fix by platform

SQL

  1. ALTER TABLE customers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

How to diagnose

  1. Columns — SHOW FULL COLUMNS collations?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.