Laravel 5.4 failing on php artisan migrate after php artisan make:auth

1.执行

$ php artisan migrate

报错:

[Illuminate\Database\QueryException]                                            
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too   
  long; max key length is 767 bytes (SQL: alter table `users` add unique `users_  
  email_unique`(`email`))                                                         
                                                                            
  [PDOException]                                                                  
  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too   
  long; max key length is 767 bytes     

2.解决:
修改app\Providers\AppServiceProvider.php

use Illuminate\Support\Facades\Schema;

function boot()
{
    Schema::defaultStringLength(191);
}

你可能感兴趣的:(Laravel 5.4 failing on php artisan migrate after php artisan make:auth)