0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[rails db:migrate]Mysql2::Errorを簡単に解決する方法

Posted at

rails db:migrateでエラーになる原因 :文字数制限によるもの

Image from Gyazo

Mysql2::Error: Specified key was too long; max key length is 767 bytesになるのはconfig/database.ymlの文字コードがutf8mb4のままだからです。
以下のようにutf8に変更しましょう。
Image from Gyazo

再度rails db:migrateを実行するとこのエラーは出ないはずです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?