String data, right truncated: 1406 Data too long for column

后端 未结 2 790
迷失自我
迷失自我 2021-01-25 17:01

The issue I am having is I am receiving the following error, I went into MySql and ran:

ALTER TABLE block_content__field_views_reference_book 
MODIFY COLUMN fiel         


        
2条回答
  •  难免孤独
    2021-01-25 17:06

    What version? What CHARACTER SET? And other issues. Before version 5.5, there was CHARACTER SET utf8, which needs up to 3 bytes per character, but not utf8mb4, which needs up to 4. With 5.7 (10.2?), the problem was 'solved'. Meanwhile, an index had been limited to 767 bytes; not it is 3072.

    Your index on a VARCHAR(500) needs 1500 or 2000 bytes.

    Here is my list of 5 things that could be done: http://mysql.rjweb.org/doc.php/limits#767_limit_in_innodb_indexes

    You need to choose among them based on which flaw you can live with.

提交回复
热议问题