After migrating a MySQL database to a new server, customer names show up as "José" and "Müller" in the app.
IntermediateTroubleshootingData loss and corruption
Answer
Likely causes → Character set mismatch, usually double encoding. UTF-8 bytes were read as latin1 during the dump or import (or the client connection charset differs from the column charset), then stored again as UTF-8.
Diagnose →
SHOW VARIABLES LIKE 'character_set%';
SHOW CREATE TABLE customers\G
SELECT name, HEX(name) FROM customers WHERE id = 42; -- C383C2A9 instead of C3A9 means double encoded
Fix → Stop writes to affected tables, re-dump from the old server with the correct charset (mysqldump --default-character-set=utf8mb4), and re-import. For rows already corrupted, convert them back with CONVERT(CAST(CONVERT(name USING latin1) AS BINARY) USING utf8mb4) after testing on a copy.
Prevent → Use utf8mb4 everywhere (server, database, tables, connections), set the charset explicitly in dumps and connection strings, and include non-ASCII sample rows in migration checks.
More on Data loss and corruption
An engineer ran `DELETE FROM orders;` on the production Postgres (forgot the `WHERE`) at 14:32.BeginnerA cleanup script deleted every object under `s3://acme-invoices/2025/`. Versioning is enabled.BeginnerYou need to restore last night's MySQL backup and discover the dump files for the past three months are 20 KB each.IntermediateUsers update their profile, the page reloads, and they see the old values; a minute later the new values show up.IntermediateA network partition between data centres lasted 4 minutes; afterwards you find both sites accepted writes as primary, and the same order IDs exist with different contents.AdvancedA deploy ran a migration that dropped the `phone` column; old pods still running during the rolling update threw 500s, and a background job wrote nulls into a new table.Intermediate