Post Top Ad

Post Top Ad

Friday, June 14, 2019

Laravel 5.8: Specified key was too long error

Laravel 5.4: Specified key was too long error



Laravel made a change to the database character set to utf8mb4 which support for storing emojis. This only affects the application from 5.4 or higher Laravel. If you run mysql version 5.7.7 and higher you don't need to do anything. For those running MariaDB or older versions of MySQL you may hit this error when trying to run migrations:

use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }


After that everything should work as normal.

No comments:

Post a Comment