1366 MySQL Origin: Data Last updated 9 Oct 2026

MySQL ERROR 1366: Incorrect string value: '\xF0\x9F\x98\x80' for column

The text contains characters (usually emoji) that the column’s character set can’t store — the column or connection is utf8/utf8mb3 instead of utf8mb4.

Exact message you may see Incorrect string value
Seen on: MySQL PHP

Meaning

MySQL’s legacy utf8 stores at most 3 bytes per character. Emoji and some CJK characters need 4 bytes (\xF0…). Both the column/table and the connection charset must be utf8mb4.

Common causes

  • Column or table uses utf8/utf8mb3 or latin1
  • Connection charset not utf8mb4 (DSN missing charset=utf8mb4)
  • Database default charset outdated after migration

⚡ Quick fix

  1. Convert the table: ALTER TABLE t CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  2. Use charset=utf8mb4 in the connection DSN
  3. Set database default to utf8mb4 for new tables

Detailed fix by platform

MySQL

  1. Convert database and table:
    sql
    ALTER DATABASE appdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    ALTER TABLE comments CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

PHP

  1. PDO: mysql:host=…;dbname=…;charset=utf8mb4. On old MySQL 5.6, indexed VARCHAR(255) columns may need to shrink to 191 for utf8mb4.

How to diagnose

  1. Column — SHOW FULL COLUMNS FROM t — collation?
  2. Connection — SHOW VARIABLES LIKE 'character_set_%' from the app connection
  3. Data — Emoji or 4-byte characters present?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

1064 — MySQL ERROR 1064 (42000): You have an error in your SQL syntax (MySQL)10641071 — MySQL ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes (MySQL)10711267 — MySQL ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '=' (SQL)12671366 — MySQL ERROR 1366 (HY000): Incorrect integer value: '' for column 'x' at row 1 (MySQL)13661406 — MySQL ERROR 1406: Data too long for column (MySQL)1406Unknown collation — MySQL ERROR 1273 (HY000): Unknown collation: 'utf8mb4_0900_ai_ci' (MySQL)Unknown collation1366

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.