Altering character set and collation of tables in MySQL

by Martin Westin in


Altering the character set and collation of a table is sometimes not enough. You may have to alter the actual fields in the table to get MySQL to comply in some cases. I don't know why or when MySQL does this.

ALTER TABLE my_table DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;

ALTER TABLE my_table MODIFY my_field varchar(255) CHARACTER SET utf8 COLLATE utf8_swedish_ci;