创建索引的时候报错 :Index column size too large. The maximum column size is 767 bytes.
改数据库文件
default_storage_engine = InnoDB
innodb_large_prefix=on
innodb_file_format = BARRACUDA
alter table `表名` row_format=dynamic;
alter table `表名` row_format=compressed;
终极方法
在 App\Providers\AppServiceProvider 的 boot () 方法中添加
\Illuminate\Support\Facades\Schema::defaultStringLength(191);
即可
–mosou

本文详细介绍了在MySQL中创建索引时报错“Index columns too large. The maximum column size is 767 bytes”的解决方案,包括调整数据库配置、更改表行格式及使用Laravel框架进行字符串长度设置的方法。
467

被折叠的 条评论
为什么被折叠?



