系统导入core.sql时,建立索引报错

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

经查mysql官方文档【https://dev.mysql.com/doc/refman/5.7/en/create-index.html】

Prefix support and lengths of prefixes (where supported) are storage engine dependent. For example, a prefix can be up to 767 bytes long for InnoDB tables or 3072 bytes if the innodb_large_prefix option is enabled. For MyISAM tables, the prefix length limit is 1000 bytes. The NDB storage engine does not support prefixes (see Section 20.1.7.6, “Unsupported or Missing Features in NDB Cluster”).

所以需要将所有parent_codes、tree_sorts长度缩短,考虑utf-8为3个字符,所以直接改动为600,即可创建成功。