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

后端 未结 2 767
迷失自我
迷失自我 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.

    0 讨论(0)
  • 2021-01-25 17:13

    this is what i tried and it works, for drupal 8

      ALTER TABLE node_field_data MODIFY title VARCHAR(500);
     ALTER TABLE node_field_revision MODIFY title VARCHAR(500);
    
    0 讨论(0)
提交回复
热议问题