問題描述
如何更改限制
行大小太大 (> 8126). 將某些列更改為 TEXT 或 BLOB 或使用 ROW_FORMAT=DYNAMIC 或 ROW_FORMAT=COMPRESSED
可能會有所幫助.在當前行格式中,內聯存儲 768 字節的 BLOB
前綴.
表格:
id int(11) 否姓名 文字 否日期 日期 否時間 時間 否調度 int(11) 否類別 int(11) 否top_a varchar(255) 否top_b varchar(255) 否top_c varchar(255) 否top_d varchar(255) 否top_e varchar(255) 否top_f varchar(255) 否top_g varchar(255) 否top_h varchar(255) 否top_i varchar(255) 否top_j varchar(255) 否top_title_a varchar(255) 否top_title_b varchar(255) 否top_title_c varchar(255) 否top_title_d varchar(255) 否top_title_e varchar(255) 否top_title_f varchar(255) 否top_title_g varchar(255) 否top_title_h varchar(255) 否top_title_i varchar(255) 否top_title_j varchar(255) 否top_desc_a 文本 否top_desc_b 文本 否top_desc_c 文本 否top_desc_d 文本 否top_desc_e 文本 否top_desc_f 文本 否top_desc_g 文本 否top_desc_h 文本 否top_desc_i 文本 否top_desc_j 文本 否狀態 int(11) 否admin_id int(11) 否
serverfault 上也有人問過這個問題.><塊引用>
你可能想看看這個文章解釋了很多關于 MySQL 行大小.需要注意的是,即使您使用TEXT 或 BLOB 字段,您的行大小仍可能超過 8K(限制為InnoDB) 因為它存儲了每個內聯字段的前 768 個字節頁面.
解決此問題的最簡單方法是使用 Barracuda 文件格式與 InnoDB.這基本上完全擺脫了這個問題僅存儲指向文本數據的 20 字節指針而不是存儲前 768 個字節.
<小時>
適用于 OP 的方法是:
將以下內容添加到
[mysqld]
部分下的my.cnf
文件中.innodb_file_per_table=1innodb_file_format = 梭子魚
ALTER
表使用ROW_FORMAT=COMPRESSED
.ALTER TABLE nombre_tabla引擎=InnoDBROW_FORMAT=壓縮KEY_BLOCK_SIZE=8;
<小時>
上述方法可能仍不能解決您的問題.這是InnoDB的已知(并驗證)錯誤strong> 引擎,現在的臨時修復是回退到 MyISAM 引擎作為臨時存儲.所以,在你的 my.cnf
文件中:
internal_tmp_disk_storage_engine=MyISAM
How can I change the limit
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED
may help. In current row format, BLOB
prefix of 768 bytes is stored inline.
Table:
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
The question has been asked on serverfault too.
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.
The method that worked for the OP there was:
Add the following to the
my.cnf
file under[mysqld]
section.innodb_file_per_table=1 innodb_file_format = Barracuda
ALTER
the table to useROW_FORMAT=COMPRESSED
.ALTER TABLE nombre_tabla ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
There is a possibility that the above still does not resolve your issues. It is a known (and verified) bug with the InnoDB engine, and a temporary fix for now is to fallback to MyISAM engine as temporary storage. So, in your my.cnf
file:
internal_tmp_disk_storage_engine=MyISAM
這篇關于更改“Mysql Row size too large"的限制的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!