Event I put the following code in service provider root() function.
Schema::defaultStringLength(191);
Do you using homestead?
I can vouch, I am getting the error even after adding the lines:
Schema::defaultStringLength(191);
and use Illuminate\Support\Facades\Schema;
in app\Providers\AppServiceProvider.php
PHP Version: 5.6.19(from WAMP package)
Laravel Version: 5.4
Voyager: ^0.11.12
MySQL Version: 5.7.11(from WAMP package)
This solution is for i dont remember exacly but for error 768 bytes? Maybe try set defaultString on 200 or more, i don't have idea...
Was reading a discussion on Laracasts
A user suggested to change the 'engine' => null', to 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC', in config/database.php
I tried it and nothing else and it worked fine. Maybe others can give it a shot?
@supernova13892 IT FUCKING WORKS! thanks. laravel team created post how to fix it based on idea that laravel uses InoDB, while it uses MyISAM hence the fix doesnt work, and when we change to INNODB it works.
@supernova13892 solution worked for me too.
When you import sql file to older mysql version without run the migrations, you need to change utf8mb4 to utf8 and utf8mb4_unicode_ci to utf8_unicode_ci
its alive!! thanks for that solution to change the database.php file
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
Was reading a discussion on Laracasts
A user suggested to change the
'engine' => null',to'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',inconfig/database.phpI tried it and nothing else and it worked fine. Maybe others can give it a shot?