赞
踩
报错信息
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` a
dd unique `users_email_unique`(`email`))
解决:
// app\Providers\AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
网上其它方法:
show variables like 'innodb_large_prefix';
set global innodb_file_per_table=on;
set global innodb_large_prefix=on;
set global innodb_file_format_max='Barracuda';
set global innodb_file_format='Barracuda';
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。