All Products
Search
Document Center

The database returns "Row size too large. "Error

Last Updated: Nov 10, 2020

Scenario

A similar error occurs when you execute an SQL statement on an apsaradb for RDS instance or a user-created MySQL database, such as a user-created database in an ECS or IDC, in the DMS console.

Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

Causes

MySQL limits the length of a single row to 65535 bytes. This limit is enforced no matter whether the InnoDB storage engine supports more storage space. For more information, see MySQL documentation.

Solution

You can use the following methods to solve the problem:

  • Convert some large fields of the varchar type into small fields of the text or blob type.
    1. Log on to the DMS console. Click the target instance and select the target database. Right-click the destination table and choose edit table structure from the shortcut menu.
    2. Click column information to change the type of a column.
  • Reduce the size of some large varcahr fields in the table based on the actual business needs and save the cost.
    1. Log on to the DMS console. Click the target instance and select the target database. Right-click the destination table and choose edit table structure from the shortcut menu.
    2. Click column information, and adjust the length of the target column based on actual conditions.

Scope

  • Data Management
  • Apsaradb for RDS
    Note: the problem applies equally to user-created MySQL databases, which are user-created databases in Elastic Compute Service (ECS) instances and user-created databases in on-premises IDCs.