Force MySQL to ignore key length error

Submitted by Darren Oh on Thu, 12/26/2019 - 23:02

If the following MySQL error prevents you from creating or altering a table, you can get the statement to execute successfully by disabling strict mode:

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

Disabling strict mode will change the error to a warning. The key will be shortened to fit the maximum key length. This is fine if you don’t need the full value in the index.