Fix MySQL Row Size Too Large Error in Skyvia Replication

Replication: MySQL Error: Row size too large (> 8126)

Overview

When performing replication to MySQL you can encounter this error: An error occurred while creating table 'Invoice'. Error: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.

It arises because the total size of the columns in a row exceeds 8126 bytes (e.g., VARCHAR(50) + VARCHAR(50) + VARCHAR(100) ...). This is due to multiple fields with variable-length data types.

Resolution

  1. Convert some columns to TEXT or BLOB. These data types allocate only a few bytes in the row to reference the data stored elsewhere, allowing more columns to fit within the row size limit. Note that this requires server-side configuration changes.
  2. Increase the row size limit (> 8126 bytes) by modifying relevant server settings, as detailed in the MariaDB InnoDB page size documentation. Note that this requires server-side configuration changes.
  3. If feasible, remove unnecessary columns from the table schema to decrease the row size.

The simplest solution is to eliminate non-essential columns, if possible, to avoid server-side modifications.