8126)。 将某些列更改为 TEXT 或 BLOB 或使用 ROW_FORMAT=DYNAMIC 或 ROW_FORMAT=COMPRESSED 可能会有所帮助。在当-6ren">
gpt4 book ai didi

mysql - "Mysql Row size too large"的更改限制

转载 作者:IT老高 更新时间:2023-10-28 12:51:51 26 4
gpt4 key购买 nike

如何更改限制

行大小过大 (> 8126)。 将某些列更改为 TEXT 或 BLOB 或使用 ROW_FORMAT=DYNAMIC 或 ROW_FORMAT=COMPRESSED 可能会有所帮助。在当前行格式中,BLOB 768 字节的前缀被内联存储。

表格:

id  int(11) No       
name text No
date date No
time time No
schedule int(11) No
category int(11) No
top_a varchar(255) No
top_b varchar(255) No
top_c varchar(255) No
top_d varchar(255) No
top_e varchar(255) No
top_f varchar(255) No
top_g varchar(255) No
top_h varchar(255) No
top_i varchar(255) No
top_j varchar(255) No
top_title_a varchar(255) No
top_title_b varchar(255) No
top_title_c varchar(255) No
top_title_d varchar(255) No
top_title_e varchar(255) No
top_title_f varchar(255) No
top_title_g varchar(255) No
top_title_h varchar(255) No
top_title_i varchar(255) No
top_title_j varchar(255) No
top_desc_a text No
top_desc_b text No
top_desc_c text No
top_desc_d text No
top_desc_e text No
top_desc_f text No
top_desc_g text No
top_desc_h text No
top_desc_i text No
top_desc_j text No
status int(11) No
admin_id int(11) No

最佳答案

该问题已在 serverfault 上提出也是。

You may want to take a look at this article which explains a lot about MySQL row sizes. It's important to note that even if you use TEXT or BLOB fields, your row size could still be over 8K (limit for InnoDB) because it stores the first 768 bytes for each field inline in the page.

The simplest way to fix this is to use the Barracuda file format with InnoDB. This basically gets rid of the problem altogether by only storing the 20 byte pointer to the text data instead of storing the first 768 bytes.


对 OP 有效的方法是:

  1. 将以下内容添加到 [mysqld] 部分下的 my.cnf 文件中。

    innodb_file_per_table=1
    innodb_file_format = Barracuda
  2. ALTER表使用ROW_FORMAT=COMPRESSED

    ALTER TABLE nombre_tabla
    ENGINE=InnoDB
    ROW_FORMAT=COMPRESSED
    KEY_BLOCK_SIZE=8;

上述方法仍有可能无法解决您的问题。这是一个 known (and verified) bug InnoDB 引擎,目前的临时修复是回退到 MyISAM 引擎作为临时存储。所以,在你的 my.cnf 文件中:

internal_tmp_disk_storage_engine=MyISAM

关于mysql - "Mysql Row size too large"的更改限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15585602/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com