Index column size too large. The maximum column size is 767 bytes.

1. 对数据库进行设置

set global innodb_file_format = BARRACUDA;

set global innodb_large_prefix = ON;

 

2. 对脚本进行修改,添加 ROW_FORMAT=DYNAMIC

例:CREATE TABLE `db_video_basic` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `title` CHAR(255) NOT NULL,
  `product_uuid` CHAR(255) NOT NULL COMMENT '唯一标识',
  `keyword` TEXT COMMENT '关键词',
  `channel_id` INT(11) NOT NULL,
  `channel_name` CHAR(50) DEFAULT NULL COMMENT '频道名',
  `column_id` INT(11) NOT NULL,
  `column_name` CHAR(50) DEFAULT NULL COMMENT '栏目名',
  `category_id` INT(11) NOT NULL,
  `category_name` CHAR(50) DEFAULT NULL COMMENT '分类名',
  `edit_status` CHAR(50) DEFAULT NULL COMMENT '编辑状态',
  `editstatus_name` CHAR(50) DEFAULT NULL COMMENT '编入方式',
  `schema_id` INT(11) DEFAULT NULL,
  `schema_name` CHAR(255) DEFAULT NULL,
  `play_time` DATETIME NOT NULL COMMENT '视频时长',
  `duration` INT(11) NOT NULL,
  `content` TEXT COMMENT '视频内容',
  `image` CHAR(255) DEFAULT NULL COMMENT '视频图片',
  `size` INT(11) NOT NULL COMMENT '视频大小',
  `url` CHAR(255) NOT NULL COMMENT '视频链接',
  `inserttime` DATETIME NOT NULL,
  `trade_type` TINYINT(4) NOT NULL DEFAULT '2' COMMENT '行业类型:1 银监会,2 保监会',
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_uuid` (`product_uuid`,`trade_type`),
  KEY `title` (`title`),
  KEY `channel_id` (`channel_id`),
  KEY `column_id` (`column_id`),
  KEY `play_time` (`play_time`),
  KEY `trade_type` (`trade_type`)
) ENGINE=INNODB AUTO_INCREMENT=70981 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='视频数据表'

你可能感兴趣的:(Index column size too large. The maximum column size is 767 bytes.)