Change limit for “Mysql Row size too large”

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:

  1. Add the following to the my.cnf file under [mysqld] section.

    innodb_file_per_table=1
    innodb_file_format = Barracuda
    
  2. ALTER the table to use ROW_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

Leave a Comment