Specified Key Was Too Long Max Key Length Is

[Solved] Specified Key Was Too Long Max Key Length Is | Ruby - Code Explorer | yomemimo.com
Question : specified key was too long; max key length is 767 bytes (s

Answered by : handsome-hawk-ca4g4lhp3n0u

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

Source : https://laravel-news.com/laravel-5-4-key-too-long-error | Last Update : Wed, 06 May 20

Question : 1071 Specified key was too long; max key length is 1000 bytes

Answered by : christian-racuya

// /app/Providers/AppserviceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot()
{	Schema::defaultStringLength(191);
}

Source : | Last Update : Tue, 09 Aug 22

Question : specified key was too long max key length is 767 bytes

Answered by : stupid-seahorse-c4yk6npbxfyq

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

Source : https://laravel-news.com/laravel-5-4-key-too-long-error | Last Update : Tue, 01 Sep 20

Question : Specified key was too long; max key length is 1000 bytes

Answered by : deepak-solanki

In app\Providers\AppServiceProvider.php File
// Add
use Illuminate\Support\Facades\Schema;
public function boot() {	// Add In boot function	Schema::defaultStringLength(191);
}

Source : | Last Update : Sat, 05 Dec 20

Question : Specified key was too long; max key length is 767 bytes

Answered by : puzzled-piranha-ugpnitu5ba6m

I had this error and I changed my tables column length smaller for the indexed foreign key columns so I changed it like this:
VARCHAR(1024)
To:
VARCHAR(512)
And run the query again.

Source : https://stackoverflow.com/questions/8746207/1071-specified-key-was-too-long-max-key-length-is-1000-bytes | Last Update : Mon, 07 Nov 22

Answers related to specified key was too long max key length is 767 bytes s

Code Explorer Popular Question For Ruby