简体   繁体   English

mysqli行大小太大

[英]mysqli row size too large

i am trying to insert data into a mysql table that is using the innodb storage engine and am getting this error: 我试图将数据插入正在使用innodb存储引擎的mysql表中,并收到此错误:

Mysqli statement execute error : 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 understand the error, but my table is made up of almost only text and mediumtext columns. 我理解该错误,但是我的表几乎只由text和mediumtext列组成。 basically, i am trying to store a bunch of xml responses from a web service that are of variable length. 基本上,我正在尝试从Web服务中存储一堆长度可变的xml响应。 i am able to save these responses (the requests happen sequentially in a batch process) until i get to col14, where the insert of the response gives the above error 我能够保存这些响应(请求在批处理过程中按顺序发生),直到到达col14为止,在该处插入响应会出现上述错误

my backup idea if i can't get this to work is to just save the xml on the server and put the file location in the database. 我的备份想法(如果我无法解决)是将xml保存在服务器上,并将文件位置放入数据库中。

i have included the create table code 我已包含创建表代码

CREATE TABLE IF NOT EXISTS `qb_results` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `col1` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
  `col2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `col3` text COLLATE utf8_unicode_ci,
  `col4` text COLLATE utf8_unicode_ci,
  `col5` text COLLATE utf8_unicode_ci,
  `col6` text COLLATE utf8_unicode_ci,
  `col7` mediumtext COLLATE utf8_unicode_ci,
  `col8` mediumtext COLLATE utf8_unicode_ci,
  `col9` mediumtext COLLATE utf8_unicode_ci,
  `col10` mediumtext COLLATE utf8_unicode_ci,
  `col11` mediumtext COLLATE utf8_unicode_ci,
  `col12` mediumtext COLLATE utf8_unicode_ci,
  `col13` mediumtext COLLATE utf8_unicode_ci,
  `col14` mediumtext COLLATE utf8_unicode_ci,
  `col15` mediumtext COLLATE utf8_unicode_ci,
  `col16` mediumtext COLLATE utf8_unicode_ci,
  `col17` mediumtext COLLATE utf8_unicode_ci,
  `col18` mediumtext COLLATE utf8_unicode_ci,
  `updated_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=61 ;

edit - changed columns to be numbered because they were business specific and didn't feel it was necessary or relevant to include their actual column names. 编辑-更改了要编号的列,因为它们是特定于业务的,并且认为没有必要或相关的实际列名。 normalizing would actually solve the problem but still does not explain the error given the context (error says to use text columns, which are being used already) 规范化实际上可以解决问题,但仍不能在给定上下文的情况下解释错误(错误表示使用文本列,而该文本列已在使用)

I was also having the same issue. 我也有同样的问题。 Do the following: set ENGINE=MyISAM. 请执行以下操作:设置ENGINE = MyISAM。 Also, if your script is bulky you might want to change the execution time of your script. 另外,如果您的脚本过大,则可能需要更改脚本的执行时间。 In that case open the configuration file of PHP (php.ini for windows) and set 在这种情况下,打开PHP的配置文件(对于Windows为php.ini)并设置

max_execution_time=150 //(suppose) you can set it whatever you feel right.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM