[Solved] MySQL Add New Field Error: ERROR 1118 — Row size too large. The maximum row size for the used table type

error message

1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.
You have to change some columns to TEXT or BLOBs

Error reason

When MySQL builds a table, there is a limit on the maximum length of a single row: the total number of bytes set in all fields in a table is not more than 65535 bytes

Note 1: when the size of a single field exceeds 65535, it is converted to text
note 2: the sum of other fields does not exceed 65535 bytes (excluding blob/text)
note 3: the database uses UTF-8 encoding, and one character = three bytes
error reporting example: there are 10 varchar fields in the database, If each size is 3000, the current calculation length of the database single line is 3000 * 10 * 3 = 90000 & gt; 65535

Solution: set the large field type of the database table to text, or reduce the length of some parts that can be reduced to less than 65535

Similar Posts: