mysql Error:index column size too large. the maximum column size is 767 bytes

发布时间 2023-03-31 12:30:21作者: maoxianww

问题现象

mysql在执行脚本create创建表时,提示以下错误:

index column size too large. the maximum column size is 767 bytes

异常原因

INNODB 引擎,UTF-8,主键字符串 默认最大 767,需要修改

解决方案

  1. 对数据库进行设置
    set global innodb_large_prefix = ON

参考博客