Is this a safe way to convert MySQL tables from latin1 to utf-8?

前端 未结 3 1800
礼貌的吻别
礼貌的吻别 2020-12-19 01:37

I need to change all the tables in one of my databases from latin1 to utf-8 (with utf8_bin collation).

I have dumped the database, created a test database from it, a

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 02:42

    A straightforward conversion will potentially break any strings with non-utf7 characters.

    If you don't have any of those (i.e. all of your text is english), you'll usually be fine.

    If you've any of those, however, you need to convert all char/varchar/text fields to blob in an initial run, and to convert them to utf8 in a subsequent run.

    See this article for detailed procedures:

    http://codex.wordpress.org/Converting_Database_Character_Sets

提交回复
热议问题