Overview

Like all database systems, MySQL and MariaDB have limits on certain sizes of items which in rare circumstances may cause an error on your website. If you’re receiving an error based on row size limits, it may appear as:

ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help.

Or:

WordPress database error Index column size too large. The maximum column size is 767

This may appear as other similar errors or indicate different size limits. These limitations are due to an older default row format used for the database (compact), which opted for space savings over flexibility.

Warning

Ensure you take a backup before making any database changes.

Instructions

To fix the error, we can update the row format for the database to Dynamic which allows for greater column and header sizes.

Note

These instructions are meant for experienced web developers and database administrators. If you’re unsure, please contact your developer or administrator first before making any changes.

  1. Login to Plesk, then go to phpMyAdmin for the affected database.
  2. Select the affected table, then go to Structure:
    how to fix "row size too large" errors
  3. Scroll down to the Information section and confirm the current row format is Compact:
    how to fix "row size too large" errors
  4. If it’s set to Compact, we can alter the table structure to use the Dynamic row format, then issue an OPTIMIZE command to cleanly re-create the table:
    ALTER TABLE `<TABLENAME>` ROW_FORMAT=DYNAMIC;
    OPTIMIZE TABLE `<TABLENAME>`;
  5. Test that the function or part of the website causing the error has now been resolved.

Related Articles