当前位置:网站首页>[mysql] data synchronization prompt: specified key was too long; max key length is 767 bytes

[mysql] data synchronization prompt: specified key was too long; max key length is 767 bytes

2022-06-22 17:12:00 Seven days at night

see MYSQL edition :5.6.45

Database character set :utf8

Sort rule :utf8_general_ci

Specified key was too long;max key length is 767 bytes

Google Translate : The specified key is too long ; The maximum key length is 767 byte

It is found that the length of the index field exceeds the limit ,5.6 The maximum length of the version is 767 byte ;

Generally speaking varchar or text This problem can easily occur when the type is set to index ,utf8 One character takes up 3 byte , If set 255 length , Then for 765 byte ; If the set length is 256, Then for 768 byte ; It's easy to exceed the upper limit .

Solution :

1. Set the index field length to 255;

2. upgrade mysql edition ;

3. Reduce the index field length to 256 following .

原网站

版权声明
本文为[Seven days at night]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221522489444.html