Mysql2::Error: Specified key was too long; max key length is 3072 bytes #238
-
I'm getting this error when trying to run the migration: I'm running Rails 6.1.4.1, MySQL 8.0.26. The adapter is mysql2 and encoding utf8mb4. Any ideas on how to fix this issue? I looked quite bit online and tried several "solutions" without any luck. I can provide more information if needed. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
I haven't encountered this myself. A good strategy might be to apply the migration changes one by one and see which exact step fails. |
Beta Was this translation helpful? Give feedback.
-
@jonhue The step below fails:
|
Beta Was this translation helpful? Give feedback.
-
full error message as below:
|
Beta Was this translation helpful? Give feedback.
-
change the migration like this will make it work:
You won't have a class name longer than 50 normally~ |
Beta Was this translation helpful? Give feedback.
-
@0000sir Thank you! The migration change worked for me. |
Beta Was this translation helpful? Give feedback.
change the migration like this will make it work:
You won't have a class name longer than 50 normally~