2

I have an application in Django and MySQL, in my model I have several fields specified as TextField, when i run syncdb the tables for my model are created and the specified columns are created with longtext data type, so far so good.

But when I try, enter information in the table I get the following error

DatabaseError: (1118, 'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs ")

I changed the column type to Text and Blob, and did not solve the problem.

I've been reading about this error and is due to more than 8126bytes income information by row. So I changed the configuration of MySQL to work with the file type Barracuda instead of Antepode, which I have been reading allows compression of sending information over to a different file.

But this did not solve the problem, in the MySQL documentation (https://dev.mysql.com/doc/refman/5.5/en/innodb-compression-usage.html) tells me that I have to specify ROW_FORMAT = COMPRESSED when i create the table, but this is done by syncdb,

Is there way to specify these settings when syncdb creates the tables or I have to create the tables manually without using syncdb?

Any other suggestions would be welcome, in my application I have to store multiple sheets and reports. I have defined a column in my table by section of the document.

4

1 回答 1

1

我解决了使用 innodb 在 MySQL 中添加大数据行的错误

DatabaseError: (1118, 'Row size too large. 所用表类型的最大行大小,不包括 BLOB,为 8126。您必须将某些列更改为 TEXT 或 BLOB")

首先,我们必须将文件格式设置为 Barracuda 并在 MySQL 中为每个表全局变量启用一个文件:

SET GLOBAL innodb_file_format = 梭子鱼;
设置全球 innodb_file_format_check = ON; SET GLOBAL innodb_format_max = 梭子鱼;设置全局 innodb_file_per_table = ON;

我使用 phpmyadmin 进行查询。

然后在运行 syncdb 之后,我们转到存在大行问题的表,转到选项卡 Operations->Table Options,然后将“ROW_FORMAT”修改为“COMPRESS”。

我希望这可以帮到你

于 2012-12-04T19:34:31.497 回答