When migrating the database, it constantly produces such an error, I do not understand what needs to be fixed.
- oneDo you give all the data? How much unnecessary body movements will have to be done by a person who wants to sort out your problem ? Stackoverflow.com/help/how-to-ask - Alexander Muksimov
- laravel-news.com/laravel-5-4-key-too-long-error - Rustam Gimranov
- onetext information is better to attach as text: a) easier to read; b) can be copied; c) the search works. You can correct the question text by clicking below to edit the question text - aleksandr barakin
|
1 answer
In the app/Providers/AppServiceProvider.php provider, add the following line in the boot() method:
function boot() { Schema::defaultStringLength(191); } This error occurs because the MyqSQL server is lower than version 5.7.7, since the character encoding was changed from utf8 to utf8mb4 from version 5.4 utf8mb4
- thank you so much! - Sergey Kuznetsov
|