gpt4 book ai didi

mysql - 无法将表字符集编码从 latin1_swedish_ci 更改为 utf8mb4_bin

转载 作者:行者123 更新时间:2023-11-29 21:11:09 28 4
gpt4 key购买 nike

尝试通过此查询更改表

 ALTER TABLE `outlooks` CHANGE `description` `description` TEXT    CHARSET=utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL;

但出现错误

 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL' at line 1

最佳答案

这不是正确的语法。该错误也非常清楚地表明了问题所在。

根据the manual它应该看起来像:

ALTER TABLE `outlooks`
CHANGE `description`
`description` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL;

但是,这不会将数据表的内容从 ISO-8859-1 转换为 UTF8。你可能是looking for :

ALTER TABLE `outlooks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

关于mysql - 无法将表字符集编码从 latin1_swedish_ci 更改为 utf8mb4_bin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36352018/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com