将字符集从latin1迁移到utf8

时间:2015-11-13 08:19:47

标签: mysql utf-8 mysql-5.6

我需要更改架构的字符集以及架构中的所有表格来自' latin1 '到' utf8 '。我已经拥有当前架构中的数据。那么从' latin1 '迁移字符集的方式是什么?到' utf8 ' 数据库大小为200 GB。备份和恢复需要迁移字符集。请帮助我

1 个答案:

答案 0 :(得分:1)

为每个表格执行此操作

ALTER TABLE tab CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

或者阅读:http://archive.oreilly.com/pub/post/turning_mysql_data_in_latin1_t.html

或使用此转换您的sqldump Best way to convert text files between character sets?