When I was doing data processing on the MySQL database today , I encountered an error:
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help.
The table I am dealing with has 400 columns and a large number of VARCHAR and TEXT columns. I have encountered an error that the total length of VARCHAR in this table exceeds 65532. At first glance, I mistakenly thought it was the problem of VARCHAR being too long.
[Try 1] So I replaced some larger VARCHAR columns with TEXT types, but the problem still exists.
[Try 2] According to the error message, I added the ROW_FORMAT=DYNAMIC setting when creating the table, but the problem still exists.
[Try 3] Later, I suspected the problem of the database engine, because the MyISAM engine is commonly used, but after I newly installed mysql , the default is InnoDb, and I have not modified it. So I removed the ROW_FORMAT setting when creating the table and added Engine=MyISAM. The problem is solved.
[Principle Analysis] According to some information on the Internet, this problem may be related to the storage format used between different engines. MyISAM has 3 row storage formats: fixed/dynamic/compressed. InnoDb newly introduced Barracuda on the basis of MyIASM. As for the default settings of different engines and the differences between various storage formats, I have not researched in depth. If you are interested, you can find out.
[Solution by InnoDb] Later I saw the solution in InnoDb in stackoverflow (not tried):
http://stackoverflow.com/questions/15585602/change-limit-for-mysql-row-size-too-large
[Other questions] In addition, stackoverflow also mentioned that the log file setting is too small may also cause this problem:
http://www.alanzeng.cn/2016/03/mysql-row-size-too-large-8126/
- top
- 1
- step on
When I was doing data processing on the MySQL database today , I encountered an error:
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help.
The table I am dealing with has 400 columns and a large number of VARCHAR and TEXT columns. I have encountered an error that the total length of VARCHAR in this table exceeds 65532. At first glance, I mistakenly thought it was the problem of VARCHAR being too long.
[Try 1] So I replaced some larger VARCHAR columns with TEXT types, but the problem still exists.
[Try 2] According to the error message, I added the ROW_FORMAT=DYNAMIC setting when creating the table, but the problem still exists.
[Try 3] Later, I suspected the problem of the database engine, because the MyISAM engine is commonly used, but after I newly installed mysql , the default is InnoDb, and I have not modified it. So I removed the ROW_FORMAT setting when creating the table and added Engine=MyISAM. The problem is solved.
[Principle Analysis] According to some information on the Internet, this problem may be related to the storage format used between different engines. MyISAM has 3 row storage formats: fixed/dynamic/compressed. InnoDb newly introduced Barracuda on the basis of MyIASM. As for the default settings of different engines and the differences between various storage formats, I have not researched in depth. If you are interested, you can find out.
[Solution by InnoDb] Later I saw the solution in InnoDb in stackoverflow (not tried):
http://stackoverflow.com/questions/15585602/change-limit-for-mysql-row-size-too-large
[Other questions] In addition, stackoverflow also mentioned that the log file setting is too small may also cause this problem:
http://www.alanzeng.cn/2016/03/mysql-row-size-too-large-8126/