MySQL "Incorrect string value" — Why Cannot Emojis Be Saved?
Root causes of MySQL Error 1366 when storing 4-byte UTF-8 emojis into utf8mb3, converting tables to utf8mb4_0900_ai_ci, connection charset parameters, and index size recalculation.
Operational Verification & Reliability Metadata
The error string is a symptom, not the root cause. Do not restart the server blindly. Run the diagnostic queries below to pinpoint the actual failure mode.
▸Symptoms
ERROR 1366 (HY000): Incorrect string value: '\xF0\x9F\x98\x80' for column 'yorum' at row 1The byte sequence \xF0\x9F\x98\x80 represents the 4-byte 😀 emoji. Legacy utf8 in MySQL is limited to 3 bytes (utf8mb3).
▸Resolution Patterns
- 1Convert Table to utf8mb4:
ALTER TABLE yorumlar CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;- 1Configure Client Connection:
SET NAMES utf8mb4;- 1Recalculate Index Key Widths:
Converting to utf8mb4 inflates index size from 3 to 4 bytes per character, potentially triggering MySQL Error 1071.
- •Related Error: MySQL Error 1071 Specified key was too long
- •Engine Hub: MySQL Production Hub
Other Database Error Triage Playbooks
Other battle-tested diagnostic guides for high-severity database errors.
MySQL ERROR 1045 Access denied: root Password Reset Guide
Four causes of MySQL 1045, meaning of using password: YES/NO, and safe credential recovery via --init-file.
MySQL Deadlock ERROR 1213: Graph Analysis and Permanent Prevention
Root causes of MySQL 1213 deadlock, parsing LATEST DETECTED DEADLOCK output, gap lock concurrency issues, and resilient application retry design.
MySQL Lock wait timeout exceeded: Finding Blocking Sessions
Finding the blocking transaction using performance_schema, safe KILL decision matrices, and permanent locking reduction.