How to fix MySql: index column size too large (Laravel migrate)

前端 未结 8 1345
北荒
北荒 2020-12-01 04:34

I duplicated a project with a vagrant box which installs Debian, Nginx, PhpMyAdmin, .. With the new project the Laravel\'s php artisan migrate is not working an

8条回答
  •  独厮守ぢ
    2020-12-01 05:12

    Three solutions, each with a drawback:

    • MySQL 5.7 avoids the problem. Consider upgrading.

    • VARCHAR(255) is usually var bigger than necessary. If you can safely shrink to 191 or less, the error will go away.

    • Switch to utf8 (from utf8mb4), if you don't need Chinese or Emoji.

提交回复
热议问题