Questions tagged «mysql-error-1071»

30
#1071-指定的密钥太长;最大密钥长度为767字节
当我执行以下命令时: ALTER TABLE `mytable` ADD UNIQUE ( `column1` , `column2` ); 我收到此错误消息: #1071 - Specified key was too long; max key length is 767 bytes 有关column1和column2的信息: column1 varchar(20) utf8_general_ci column2 varchar(500) utf8_general_ci 我认为varchar(20)只需要21个字节,而varchar(500)只需要501个字节。因此,总字节数是522,少于767。那么为什么收到错误消息? #1071 - Specified key was too long; max key length is 767 bytes
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.