【已解决】mysql Error:index column size too large. the maximum column size is 767 bytes

问题现象

我遇到的问题是 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

参考博客

posted @ 2023-03-31 12:20  maoxianww  阅读(111)  评论(0编辑  收藏  举报