行大小太大。使用的表类型的最大行大小(不包括BLOB)是8126.您必须将某些列更改为TEXT或BLOB

时间:2013-03-13 07:24:09

标签: mysql

我的表结构:

CREATE TABLE `goal_review` (
    `id` BIGINT(25) NOT NULL AUTO_INCREMENT,
    `user_review_info` BIGINT(25) UNSIGNED NOT NULL DEFAULT '0',
    `SKILL_COMPETENCY_MID_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `SKILL_COMPETENCY_MID_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `SKILL_COMPETENCY_ANNUAL_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `SKILL_COMPETENCY_ANNUAL_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `SKILL_COMPETENCY_OBJECTIVE` LONGTEXT NULL,
    `SKILL_COMPETENCY_CONDITION` LONGTEXT NULL,
    `SKILL_COMPETENCY_MEASURE` LONGTEXT NULL,
    `SKILL_COMPETENCY_TIMING` LONGTEXT NULL,
    `SKILL_COMPETENCY_TYPE` LONGTEXT NULL,
    `SKILL_COMPETENCY_WEIGHTAGE` LONGTEXT NULL,
    `SKILL_COMPETENCY_ANNUAL_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `SKILL_COMPETENCY_MID_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `SKILL_COMPETENCY_ANNUAL_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `SKILL_COMPETENCY_MID_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `PROJECT_DELIVERY_MID_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `PROJECT_DELIVERY_MID_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `PROJECT_DELIVERY_ANNUAL_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `PROJECT_DELIVERY_ANNUAL_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `PROJECT_DELIVERY_OBJECTIVE` LONGTEXT NULL,
    `PROJECT_DELIVERY_CONDITION` LONGTEXT NULL,
    `PROJECT_DELIVERY_MEASURE` LONGTEXT NULL,
    `PROJECT_DELIVERY_TIMING` LONGTEXT NULL,
    `PROJECT_DELIVERY_TYPE` LONGTEXT NULL,
    `PROJECT_DELIVERY_WEIGHTAGE` LONGTEXT NULL,
    `PROJECT_DELIVERY_ANNUAL_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `PROJECT_DELIVERY_MID_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `PROJECT_DELIVERY_ANNUAL_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `PROJECT_DELIVERY_MID_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `BUSINESS_MID_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `BUSINESS_MID_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `BUSINESS_ANNUAL_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `BUSINESS_ANNUAL_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `BUSINESS_OBJECTIVE` LONGTEXT NULL,
    `BUSINESS_CONDITION` LONGTEXT NULL,
    `BUSINESS_MEASURE` LONGTEXT NULL,
    `BUSINESS_TIMING` LONGTEXT NULL,
    `BUSINESS_TYPE` LONGTEXT NULL,
    `BUSINESS_WEIGHTAGE` LONGTEXT NULL,
    `BUSINESS_ANNUAL_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `BUSINESS_MID_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `BUSINESS_ANNUAL_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `BUSINESS_MID_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `COMPLIANCE_MID_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `COMPLIANCE_MID_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `COMPLIANCE_ANNUAL_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `COMPLIANCE_ANNUAL_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `COMPLIANCE_OBJECTIVE` LONGTEXT NULL,
    `COMPLIANCE_CONDITION` LONGTEXT NULL,
    `COMPLIANCE_MEASURE` LONGTEXT NULL,
    `COMPLIANCE_TIMING` LONGTEXT NULL,
    `COMPLIANCE_TYPE` LONGTEXT NULL,
    `COMPLIANCE_WEIGHTAGE` LONGTEXT NULL,
    `COMPLIANCE_ANNUAL_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `COMPLIANCE_MID_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `COMPLIANCE_ANNUAL_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `COMPLIANCE_MID_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `LONG_TERM_MID_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `LONG_TERM_MID_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `LONG_TERM_ANNUAL_REVIEW_SELF_COMMENTS` LONGTEXT NULL,
    `LONG_TERM_ANNUAL_REVIEW_MANAGER_COMMENTS` LONGTEXT NULL,
    `LONG_TERM_OBJECTIVE` LONGTEXT NULL,
    `LONG_TERM_CONDITION` LONGTEXT NULL,
    `LONG_TERM_MEASURE` LONGTEXT NULL,
    `LONG_TERM_TIMING` LONGTEXT NULL,
    `LONG_TERM_TYPE` LONGTEXT NULL,
    `LONG_TERM_WEIGHTAGE` LONGTEXT NULL,
    `LONG_TERM_ANNUAL_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `LONG_TERM_MID_REVIEW_SELF_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `LONG_TERM_ANNUAL_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    `LONG_TERM_MID_REVIEW_MANAGER_RATING` INT(10) UNSIGNED NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    INDEX `FK_goal_review_user_review_info` (`user_review_info`),
    INDEX `FK_GRSKILL_COMPETENCY_ANNUAL_REVIEW_MANAGER_RATING` (`SKILL_COMPETENCY_ANNUAL_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRSKILL_COMPETENCY_MID_REVIEW_MANAGER_RATING` (`SKILL_COMPETENCY_MID_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRSKILL_COMPETENCY_ANNUAL_REVIEW_SELF_RATING` (`SKILL_COMPETENCY_ANNUAL_REVIEW_SELF_RATING`),
    INDEX `FK_GRSKILL_COMPETENCY_MID_REVIEW_SELF_RATING` (`SKILL_COMPETENCY_MID_REVIEW_SELF_RATING`),
    INDEX `FK_GRPROJECT_DELIVERY_ANNUAL_REVIEW_MANAGER_RATING` (`PROJECT_DELIVERY_ANNUAL_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRPROJECT_DELIVERY_MID_REVIEW_MANAGER_RATING` (`PROJECT_DELIVERY_MID_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRPROJECT_DELIVERY_ANNUAL_REVIEW_SELF_RATING` (`PROJECT_DELIVERY_ANNUAL_REVIEW_SELF_RATING`),
    INDEX `FK_GRPROJECT_DELIVERY_MID_REVIEW_SELF_RATING` (`PROJECT_DELIVERY_MID_REVIEW_SELF_RATING`),
    INDEX `FK_GRBUSINESS_ANNUAL_REVIEW_MANAGER_RATING` (`BUSINESS_ANNUAL_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRBUSINESS_MID_REVIEW_MANAGER_RATING` (`BUSINESS_MID_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRBUSINESS_ANNUAL_REVIEW_SELF_RATING` (`BUSINESS_ANNUAL_REVIEW_SELF_RATING`),
    INDEX `FK_GRBUSINESS_MID_REVIEW_SELF_RATING` (`BUSINESS_MID_REVIEW_SELF_RATING`),
    INDEX `FK_GRCOMPLIANCE_ANNUAL_REVIEW_MANAGER_RATING` (`COMPLIANCE_ANNUAL_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRCOMPLIANCE_MID_REVIEW_MANAGER_RATING` (`COMPLIANCE_MID_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRCOMPLIANCE_ANNUAL_REVIEW_SELF_RATING` (`COMPLIANCE_ANNUAL_REVIEW_SELF_RATING`),
    INDEX `FK_GRCOMPLIANCE_MID_REVIEW_SELF_RATING` (`COMPLIANCE_MID_REVIEW_SELF_RATING`),
    INDEX `FK_GRLONG_TERM_ANNUAL_REVIEW_MANAGER_RATING` (`LONG_TERM_ANNUAL_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRLONG_TERM_MID_REVIEW_MANAGER_RATING` (`LONG_TERM_MID_REVIEW_MANAGER_RATING`),
    INDEX `FK_GRLONG_TERM_ANNUAL_REVIEW_SELF_RATING` (`LONG_TERM_ANNUAL_REVIEW_SELF_RATING`),
    INDEX `FK_GRLONG_TERM_MID_REVIEW_SELF_RATING` (`LONG_TERM_MID_REVIEW_SELF_RATING`),
    CONSTRAINT `FK_GRLONG_TERM_ANNUAL_REVIEW_MANAGER_RATING` FOREIGN KEY (`LONG_TERM_ANNUAL_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRLONG_TERM_MID_REVIEW_MANAGER_RATING` FOREIGN KEY (`LONG_TERM_MID_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRLONG_TERM_ANNUAL_REVIEW_SELF_RATING` FOREIGN KEY (`LONG_TERM_ANNUAL_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRLONG_TERM_MID_REVIEW_SELF_RATING` FOREIGN KEY (`LONG_TERM_MID_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_goal_review_user_review_info` FOREIGN KEY (`user_review_info`) REFERENCES `user_review_info` (`ID`),
    CONSTRAINT `FK_GRBUSINESS_ANNUAL_REVIEW_MANAGER_RATING` FOREIGN KEY (`BUSINESS_ANNUAL_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRBUSINESS_ANNUAL_REVIEW_SELF_RATING` FOREIGN KEY (`BUSINESS_ANNUAL_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRBUSINESS_MID_REVIEW_MANAGER_RATING` FOREIGN KEY (`BUSINESS_MID_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRBUSINESS_MID_REVIEW_SELF_RATING` FOREIGN KEY (`BUSINESS_MID_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRCOMPLIANCE_ANNUAL_REVIEW_MANAGER_RATING` FOREIGN KEY (`COMPLIANCE_ANNUAL_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRCOMPLIANCE_ANNUAL_REVIEW_SELF_RATING` FOREIGN KEY (`COMPLIANCE_ANNUAL_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRCOMPLIANCE_MID_REVIEW_MANAGER_RATING` FOREIGN KEY (`COMPLIANCE_MID_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRCOMPLIANCE_MID_REVIEW_SELF_RATING` FOREIGN KEY (`COMPLIANCE_MID_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRPROJECT_DELIVERY_ANNUAL_REVIEW_MANAGER_RATING` FOREIGN KEY (`PROJECT_DELIVERY_ANNUAL_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRPROJECT_DELIVERY_ANNUAL_REVIEW_SELF_RATING` FOREIGN KEY (`PROJECT_DELIVERY_ANNUAL_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRPROJECT_DELIVERY_MID_REVIEW_MANAGER_RATING` FOREIGN KEY (`PROJECT_DELIVERY_MID_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRPROJECT_DELIVERY_MID_REVIEW_SELF_RATING` FOREIGN KEY (`PROJECT_DELIVERY_MID_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRSKILL_COMPETENCY_ANNUAL_REVIEW_MANAGER_RATING` FOREIGN KEY (`SKILL_COMPETENCY_ANNUAL_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRSKILL_COMPETENCY_ANNUAL_REVIEW_SELF_RATING` FOREIGN KEY (`SKILL_COMPETENCY_ANNUAL_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRSKILL_COMPETENCY_MID_REVIEW_MANAGER_RATING` FOREIGN KEY (`SKILL_COMPETENCY_MID_REVIEW_MANAGER_RATING`) REFERENCES `appraisal_rating` (`ID`),
    CONSTRAINT `FK_GRSKILL_COMPETENCY_MID_REVIEW_SELF_RATING` FOREIGN KEY (`SKILL_COMPETENCY_MID_REVIEW_SELF_RATING`) REFERENCES `appraisal_rating` (`ID`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;

我可以插入最小数据,但我无法为LONGTEXT字段插入500个字符。

我尝试BLOBTEXT而不是LONG TEXT

3 个答案:

答案 0 :(得分:0)

Blob用于以二进制格式存储数据,而TEXT存储大型String。

BLOB值被视为二进制字符串。它们没有字符集,排序和比较基于列值中字节的数值。

TEXT值被视为非二进制字符串(字符串)。它们具有字符集,并根据字符集的整理对值进行排序和比较。

文本格式消息几乎总是存储为TEXT。

答案 1 :(得分:0)

嗨朋友, 错是我自己。 mysql必须为每个列longtext或text文件写入文件,这些信息只存储在表中。这个文件需要这个名字由我们的inpunt生成的唯一名称。我尝试为所有列输入相同的输入。 所以mysql引擎从我的输入(对于唯一文件名)获取该索引的时间太长,这就是为什么它需要更多的行大小超过65,535字节。我尝试输入不同的输入它是由mysql引擎没有错误。如果我的错误,请给出你的答案 再次向Jeevan Patil致谢快速回复

答案 2 :(得分:0)

这可能是一个更复杂的问题,但出于开发目的,只需添加到my.cnf/my.ini

[mysqld]
#...
innodb_strict_mode = 0