知乎专栏 |
这个保存通常出现在高版本数据库向低版本数据导入数据,活着云主机例如阿里云。
Error Code: 1071. Specified key was too long; max key length is 767 bytes
mysql> show variables like '%innodb_large_prefix%'; +---------------------+-------+ | Variable_name | Value | +---------------------+-------+ | innodb_large_prefix | OFF | +---------------------+-------+ 1 row in set (0.00 sec)
解决方案
innodb_large_prefix=ON
mysql> set global innodb_large_prefix=on; Query OK, 0 rows affected (0.00 sec)