티스토리 뷰

laravel-news.com/laravel-5-4-key-too-long-error

 

Laravel 5.4: Specified key was too long error

Laravel 5.4 made a change to the default database character set, and it’s now utf8mb4 which includes support for storing emojis. This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not need to do anything. For

laravel-news.com

 

답은 여기에.....

 

As outlined in the Migrations guide to fix this all you have to do is edit your AppServiceProvider.php file and inside the boot method set a default string length:

 

use Illuminate\Support\Facades\Schema;

public function boot() 
{

	Schema::defaultStringLength(191);

}

'Laravel' 카테고리의 다른 글

도커(라라독) 사용하기!  (1) 2021.06.27
[Laravel 8] GraphQL을 적용해보자.  (0) 2021.04.23
라라벨7.0 생텀 spa  (1) 2020.09.07
검색시 공백 오류  (0) 2020.07.15
오늘의 페이지네이션.  (0) 2020.06.22
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함