Help Center/ GaussDB(for MySQL)/ Troubleshooting/ SQL Issues/ "Row size too large" Reported When a Table Failed to Be Created
Updated on 2023-10-19 GMT+08:00

"Row size too large" Reported When a Table Failed to Be Created

Scenario

A table failed to be created and the following information is displayed:

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

Fault Analysis

The total length of the varchar fields exceeds 65535, resulting in a table creation failure.

Solution

  1. Reduce the length.
    CREATE TABLE t1 (a VARCHAR(10000),b VARCHAR(10000),c VARCHAR(10000),d VARCHAR(10000),e VARCHAR(10000),f VARCHAR(10000) ) ENGINE=MyISAM  CHARACTER SET latin1; 
  2. Change a column to TEXT by referring to the Limits on Table Column Count and Row Size.