Character set and collation basics
summary
Explains that single-byte charsets cap at 256 characters and that MySQL’s historical utf8 is 3-byte (no CJK or emoji) while utf8mb4 uses 4 bytes, so sorting/grouping inflates memory and disk (example: three 1-byte chars become 9 bytes when promoted). Demonstrates inserting misencoded bytes via the binary operator producing irrecoverable garbage, shows how to list 4-byte sets with show character set where max_len=4, and recommends use strict sql_mode plus SET NAMES utf8mb4 and choosing narrower charsets for URLs and indexed columns.
AI-written summary · about
chapters (10)
- 0:00Character sets basics
- 1:46Multi-byte character sets impact
- 3:53Right character set for storage
- 4:35Database/table character sets
- 6:08Strict mode to prevent corruption
- 9:16Available MySQL character sets
- 10:07Collations in sorting and comparison
- 12:40Case sensitivity in collations
- 13:46String literals with character sets
- 14:29Connection character sets
related talks
59mBoosting MySQL Performance
46mHow to tame a :unicorn_face:
01h 02mThere's No Such Thing as Plain Text
26mUnderstanding MySQL Concepts
45mThe wonderful world of collations, encodings and text storage
19mThe Invisible Charset That Silently Breaks MySQL Replication
20mStoring strings in SQL Server and Azure SQL DB
55mMySQL 8.0: Not Only Good, it's GREAT
