Replication: Error: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In the current row format, the BLOB prefix of 0 bytes is stored inline.

Replication: Error: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In the current row format, the BLOB prefix of 0 bytes is stored inline.

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.

This error 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.
To resolve this error, consider the following options:
  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 article. 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.