I know there have been plenty of questions about this, but I think my math is right.
MySQL reserves the max amount for a UTF8
field which is 4 bytes, so that is why you are blowing past the 1000 byte limit. My recommendation is to create the varchar
at less than 255 or create it without UTF8
.
Both of those solutions are probably not right for you or you would have already tried that.
The only other solution I can think of is to split the column into 2 small columns and create an unique index on both of those fields, but I believe that you would get the same error as above.
Since you probably need UTF8
, I would seriously look at reducing the varchar(255)
column down a little to 250 (or 249) to make this work.