Lumen 5.6 Migrate Error Specified key was too long max key length is 767 bytes

前端 未结 6 1395
生来不讨喜
生来不讨喜 2021-02-14 16:45

I use Lumen 5.6 and mysql. when i type \"php artisan migrate\" following error occur:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t         


        
6条回答
  •  天涯浪人
    2021-02-14 17:42

    1. in bootstrap/app.php un-comment this line:
    $app->register(App\Providers\AppServiceProvider::class);
    
    1. in app/AppServiceProvider.php add below public function to AppServiceProvider class:
    public function boot()
      {
        Schema::defaultStringLength(191);
      }
    

提交回复
热议问题