MySQL error: key specification without a key length

前端 未结 16 1309
别跟我提以往
别跟我提以往 2020-11-22 08:41

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

16条回答
  •  独厮守ぢ
    2020-11-22 09:20

    You can specify the key length in the alter table request, something like:

    alter table authors ADD UNIQUE(name_first(20), name_second(20));
    

提交回复
热议问题