php artisan admin:install复制代码
Migration table created successfully.
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter table `users` add unique `users_email_unique`(`emai
l`))
In PDOStatement.php line 119:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes
In PDOStatement.php line 117:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes复制代码
laravel 5.4 改变了默认的数据库字符集,如今utf8mb4包括存储emojis支持。若是你运行MySQL v5.7.7或者更高版本,则不须要作任何事情。php
在app\Providers\AppServiceProvider.php添加默认值laravel
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; //add fixed sql
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191); //add fixed sql
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}复制代码
这个问题是laravel的问题,看到这个文章,能让第一次安装的人避开这个问题sql
如已解决此问题,可选择查看laravel-admin的各类小技巧,迈过新手的坑:juejin.im/post/5d0c39…数据库