MySQL报错[2024-05-25 09:28:14] [HY000][1366] Incorrect string value: ‘\xE8\x8B\xA5\xE4\xBE\x9D…’ for column ‘table_name’ at row 1

Mr.Jia 2024-5-25 168 5/25

MySQL官方给出的解决方案(地址

Imho utf8 charset only partially implements proper UTF-8 encoding, and it can only store UTF-8-encoded symbols that consist of one to three bytes; encoded symbols that take up four bytes aren’t supported. Please use utf8mb4..Ref http://dev.mysql.com/doc/refman/5.6/en/charset-unicode-utf8mb4.html

简单来说就是改一下字符编码就可以了

SET NAMES utf8mb4;

utf8mb4和utf8的区别

utf8mb4支持4个字符的字符编码,而uft8只支持3个,

兼容性考虑

utf8mb4仅在MySQL5.5.3之后才支持

- THE END -

Mr.Jia

5月25日09:53

最后修改:2024年5月25日
0

共有 0 条评论