1. Scene
- Version:Laravel 5.7
- Project downloaded from github, installed locally.
1. Create a new database
2. Execute the data table generation command in the project root directory (non-public directory) , and an php artisan migrateerror is reported:Syntax error or access violation: 1071 Specified key was too long
2. Screenshot of error reporting
- The migrations table was successfully generated
- An error was reported when generating the user table
- So there are 2 tables in the database, migrations and user table
3. Solution
- Open
app/prpvider/appserviceprovider.php
file - Find the
boot()
method - Set the default length of the string:
Schema::defaultStringLength(191);
- The screenshot is as follows:
4. Re-execute PHP artisan migrate again
- The error message is as follows:
- Delete the migrations and user tables in conflict.
- execute again:
php artist migrate
the data table is created successfully, as shown in the following figure:
Read More:
- Laravel model save if the table has no ID field Error [How to Solve]
- Error running ‘PigSellCabinetApplication’: Command line is too long. Shorten command line for PigSellCabinetApplication or also for Spring Boot default configuration
- [Solved] ES Query SIZE too large Error: ENTITY CONTENT IS TOO LONG [105539255] FOR THE CONFIGURED BUFFER LIMIT [104857600]
- [Solved] Android Studio Error: CreateProcess error = 206 file name or extension is too long
- [Solved] Browser Access Error: Request Header or Cookie too large
- [Solved] MYSQLD: Can‘t create directory ‘/usr/local/mysql/data/’(Errcode:2 -No such file or directory)
- [Solved] Error running ‘LocalTest‘: Command line is too long. Shorten command line for LocalTest or also for…
- Mybatis Error: Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, expect EQ
- [Solved] Error running ‘WebApplication‘: Command line is too long. Shorten command line for WebApplication or
- [Solved] Hbase …ERROR: Unable to read .tableinfo from file:/hbaseData/data/default/table1/xxxx
- Error running ‘xxxx‘“: Command line is too long… [How to Solve]
- [Solved] ELK Log System Error: “statusCode“:429,“error“:“Too Many Requests“,“message“ Data too large
- error RC2247 : SYMBOL name too long [How to Solve]
- [Solved] Intellij IDEA Error: Command line is too long
- [Solved] Intellij IDEA Run Error: Command line is too long
- laravel Error mews/captcha is locked to version 3.2.4 and an update of this package was not requested.
- [Solved] Keil5 Error: error 65: access violation at 0x08040000 : no ‘execute/read‘ permission
- SpringBoot Error running ‘Application’: Command line is too long.Shorten command line for
- [Solved] Idea Run Error: Error running ‘Application‘: Command line is too long
- [Solved] Springboot Project Startup Error: Error running XXX. Command line is too long.