MySQL 1366: Incorrect string value for column (utf8mb4 charset)
ERROR 1366 (HY000): Incorrect string value: '\xF0\x9F\x98\x80' for column 'bio' at row 1
Immediate Remediation
bash
ALTER TABLE users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Root Cause Analysis
The column's character set is utf8 (or latin1) which cannot store 4-byte UTF-8 characters like emojis; the client sent a 4-byte character but the column only supports 3-byte UTF-8, causing MySQL to reject the insert.
Verification & Guardrails
- Ensure the database, table, and connection character set are all set to utf8mb4, not just the column.
- Run ALTER TABLE on a test copy first; converting large tables can lock writes and take significant time.
- Verify the client connection charset with SET NAMES utf8mb4; otherwise the server may still interpret bytes incorrectly.
Have a custom or uncategorized crash?
Run your trace through our in-memory client privacy sandbox for instant SRE remediation.