Issue description
When you execute SQL statements for ApsaraDB RDS for MySQL instances or self-managed MySQL databases, such as ECS-hosted self-managed databases and on-premises databases in the Data Management (DMS) console, the following error message is returned:
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
Cause
When you create a table in a MySQL database, a field cannot exceed 65,535 bytes in length. The upper limit of the field length cannot be changed, no matter whether the InnoDB storage engine supports more bytes. For more information, see Limits on Table Column Count and Row Size.
Solutions
You can use one of the following methods to fix this issue:
Modify the type of fields. You can change the type of fields from a large size field to a small size field, such as from VARCHAR and CHAR to TEXT or BLOB.
Log on to the DMS console.
In the left-side navigation pane, click the database instance that you want to modify in the Database Instance section.
On the SQL Console tab, right-click the destination table and select Edit Table Structure.
On the Edit Table page, click the Column Info tab and modify the column types as needed.
Reduce the length of a field. You can reduce the length of a field of the VARCHAR type or CHAR type based on your business requirements.
Log on to the DMS console.
In the left-side navigation pane, click the database instance that you want to modify in the Database Instance section.
On the SQL Console tab, right-click the destination table and select Edit Table Structure.
On the Edit Table page, click the Column Info tab and reduce the column length as needed.
Applicable scope
DMS
ApsaraDB RDS