当前位置:Gxlcms > 数据库问题 > laravel-admin安装的时候运行php artisan admin:install命令报错SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1。。。处理方法

laravel-admin安装的时候运行php artisan admin:install命令报错SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1。。。处理方法

时间:2021-07-01 10:21:17 帮助过:17人阅读

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; //add fixed sql

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        Schema::defaultStringLength(191); //add fixed sql
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
之后运行
php artisan admin:install 命令
安装成功
成功如图所示
技术图片

 

 

 

laravel-admin安装的时候运行php artisan admin:install命令报错SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1。。。处理方法

标签:boot   use   ror   mes   state   provider   port   app   name   

人气教程排行