Migrating MySQL UTF8 to UTF8MB4 problems and questions

前端 未结 3 1129
-上瘾入骨i
-上瘾入骨i 2021-01-02 14:03

Im trying to convert my UTF8 MySQL 5.5.30 database to UTF8MB4. I have looked at this article https://mathiasbynens.be/notes/mysql-utf8mb4 but have some questions.

I

3条回答
  •  温柔的废话
    2021-01-02 14:52

    this is an old question but following some of the answers here 5 years later is, as I discovered, a bad idea. Do not alter the size of your VARCHAR fields, you could damage your data and break everything.

    In current versions of MySQL and MaraiDB add this to your config and it will support the larger keys necessary for UTF8mb4

    innodb_large_prefix=1

    I also suggest adding innodb_file_per_table =1 innodb_file_format=Barracuda

    then the conversion will happen without errors/warnings about the key length

提交回复
热议问题