下面由Laravel教學欄位帶大家介紹關於Larabel遷移檔案時報SQLSTATE[42000]錯誤的解決方法,希望對大家有幫助!
Illuminate\Database\QueryException : 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`(`email`))
<?php namespace App\Providers;use Illuminate\Support\ServiceProvider;use Illuminate\Support\Facades\Schema;class AppServiceProvider extends ServiceProvider{ public function register() { } public function boot() { Schema::defaultStringLength(191); }}
Schema::defaultStringLength(191);
相關推薦:最新的五個Laravel影片教學
以上是Larabel遷移文件發生錯誤怎麼辦?的詳細內容。更多資訊請關注PHP中文網其他相關文章!