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
I ran into this issue when I was trying to restore a backed up mysql database from a different server. What solved this issue for me was adding certain settings to my.conf (like in the questions above) and additionally changing the sql backup file:
Step 1: add or edit the following lines in my.conf:
Step 2 add ROW_FORMAT=DYNAMIC to the table create statement in the sql backup file for the table that is causing this error:
the important change above is ROW_FORMAT=DYNAMIC; (that was not included in the orignal sql backup file)
source that helped me to resolve this issue: MariaDB and InnoDB MySQL Row size too large
After spending hours I have found the solution: just run the following SQL in your MySQL admin to convert the table to MyISAM:
The other answers address the question asked. I will address the underlying cause: poor schema design.
Do not splay an array across columns. Here you have 3*10 columns that should be turned into 10 rows of 3 columns in a new table (plus
id
, etc)Your
Main
table would have onlyYour extra table (
Top
) would haveThere would be 10 (or fewer? or more?) rows in
Top
for eachid
.This eliminates your original problem, and cleans up the schema. (This is not "normalization", as debated in some of the Comments.)
Do not switch to MyISAM; it is going away.
Don't worry about
ROW_FORMAT
.You will need to change your code to do the
JOIN
and to handle multiple rows instead of multiple columns.The question has been asked on serverfault too.
The method that worked for the OP there was:
Add the following to the
my.cnf
file under[mysqld]
section.ALTER
the table to useROW_FORMAT=COMPRESSED
.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: