mysql database

mysql change single column character set

It turn`s out that there is an easy way to change the character set and collation of a single column in mysql. I usually have this issue since my provider has a swedish collation that is chosen by default when creating a column. I only realize after i get data in of course.. Here it is..

ALTER TABLE `packs`
MODIFY `packsname` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci;

To change the character set (and collation) for all columns in an existing table, use…

ALTER TABLE tbl_name CONVERT TO CHARACTER SET charset_name [COLLATE collation_name];

Leave a Reply