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: A single field whose size exceeds 65535
is converted to text
Note 2: The sum of the remaining fields does not exceed 65535
bytes (excluding BLOB/TEXT
)
Note 3: The database uses UTF-8
encoding, one character = three bytes in size
Example of an error: There are 10 varchar fields in the database, each of which has a size of 3000. The current calculated length of a single row in the database is 3000 * 10 * 3 = 90000> 65535
.
Set the large field type of the database table to TEXT
, or reduce the length of the part that can be reduced to a total of less than 65535