【问题标题】:Migration of character set from latin1 to utf8将字符集从 latin1 迁移到 utf8
【发布时间】:2015-11-13 08:19:47
【问题描述】:

我需要将架构和架构中所有表的字符集从“latin1”更改为“utf8”。我已经在当前架构中有数据。那么将字符集从“latin1”迁移到“utf8”的方法是什么 数据库大小为 200 GB。迁移字符集需要备份和恢复。请帮助我

【问题讨论】:

  • @DennisY.Parygin 我知道命令,但我是否需要备份数据并再次恢复以前的数据也是 utf8 字符集。 (或)简单的命令也会对以前的数据进行更改。

标签: mysql utf-8 mysql-5.6


【解决方案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?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-20
    • 1970-01-01
    • 2015-09-29
    • 2012-03-13
    • 2010-12-04
    • 2015-04-20
    • 2011-11-02
    • 1970-01-01
    相关资源
    最近更新 更多