Laravel5.5问题:STATE 42000: Syntax error or access violation: 1071 Specified key was too ong; max key

自己在学习laravel5.5的时候,出现了下面的错误。
白俊遥博客
于是开始疯狂百度,终于找到了解决办法。
办法如下:

1. Update the "config/database.php" for 'mysql'

> 'engine' => null,

with

> 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',

++++++++++++++++++++++++++++++++++++++++++++

2. Update the "app/Providers/AppServiceProvider.php" with

<pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 3px; word-break: normal;"><?phpnamespace App\Providers;use Illuminate\Support\ServiceProvider;use Illuminate\Support\Facades\Schema;class AppServiceProvider extends ServiceProvider{    /**     * Bootstrap any application services.     *     * @return void     */    public function boot()    {        // Specified key was too long error, Laravel News post:        Schema::defaultStringLength(191);    }    /**     * Register any application services.     *     * @return void     */    public function register()    {        //    }}

++++++++++++++++++++++++++++++++++++++++++++

3. Execute Command:

php artisan cache:clear

php artisan config:clear

php artisan voyager:install --with-dummy

Now, everything works! :)
引用地址:https://github.com/the-control-group/voyager/issues/901#issuecomment-291470960"; style="color: rgb(103, 149, 181); outline: 0px; margin: 0px; padding: 0px; box-sizing: border-box; text-decoration-line: none; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; text-align: justify; white-space: normal; background-color: rgb(255, 255, 255);" target="_blank">https://github.com/the-control-group/voyager/issues/901#issuecomment-291470960<;/a>

木点点 i
请先登录后发表评论
  • 最新评论
  • 总共0条评论