I have a table with a primary key that is a varchar(255). Some cases have arisen where 255 characters isn\'t enough. I tried changing the field to a text, but I get the foll
I got this error when adding an index to a table with text type columns. You need to declare the size amount you want to use for each text type.
Put the size amount within the parenthesis ( )
If too many bytes are used you can declare a size in the brackets for varchar to decrease the amount used for indexing. This is even if you declared a size for a type already like varchar(1000). You don't need to create a new table like others have said.
Adding index
alter table test add index index_name(col1(255),col2(255));
Adding unique index
alter table test add unique index_name(col1(255),col2(255));