时间:2021-07-01 10:21:17 帮助过:186人阅读
OK
时间: 0.011s
mysql>alter table test4 add column g varchar(769);
mysql>create index idx_test4_g on test4(g);
create index idx_test4_g on test4(g)
1071 - Specified key was too long; max key length is 3072 bytes
时间: 0.003s
原因:
因为字符串的字符集采用了utf8mb4,一个字符占4个字节,3072/4=768.
结论:
所以,字符串长度最好限制在768之内。
mysql varchar 字符串长度设定
标签:文件存储 字节 key mysq was 也有 dex arc block