Recently I blogged about identifying necessary index changes when
changing the character set for a MySQL database. In this
follow-up post I want to talk about general schema changes that
you should consider when changing your character set from latin1
to utf8, from utf8 to utf8mb4, etc. The main issue is with long
VARCHAR columns and columns with columns with length
limits that are enforeced in bytes rather than characters.
The manual points out the main areas where you may have trouble:
-
A TINYTEXT column can hold up to 255 bytes, so it can hold up to 85 3-byte or 63 4-byte characters. Suppose that you have a TINYTEXT column that uses utf8 but must be able to …