MySQL error: key specification without a key length

前端 未结 16 1299
别跟我提以往
别跟我提以往 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:19

    I know it's quite late, but removing the Unique Key Constraint solved the problem. I didn't use the TEXT or LONGTEXT column as PK , but I was trying to make it unique. I got the 1170 error, but when I removed UK, the error was removed too.

    I don't fully understand why.

提交回复
热议问题