MySQL:错误 1628:表 'customer' 的注释太长(最大 = 60) [英] MySQL: Error 1628: Comment for table 'customer' is too long (max = 60)
问题描述
修复错误 1253 后(MySQL:无法将前向工程 Sakila(样本)填入服务器),出现错误 1628.
After fixing Error 1253 (MySQL: Unable to fulling forward engineering Sakila (sample) into server), I have Error 1628.
在服务器中执行SQL脚本
Executing SQL script in server
错误:错误 1628:表 'customer' 的注释太长(最大 = 60)
ERROR: Error 1628: Comment for table 'customer' is too long (max = 60)
脚本:
CREATE TABLE IF NOT EXISTS `sakila`.`customer` (
`customer_id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT ,
`store_id` TINYINT(3) UNSIGNED NOT NULL ,
`first_name` VARCHAR(45) NOT NULL ,
`last_name` VARCHAR(45) NOT NULL ,
`email` VARCHAR(50) NULL DEFAULT NULL ,
`address_id` SMALLINT(5) UNSIGNED NOT NULL ,
`active` TINYINT(1) NOT NULL DEFAULT TRUE ,
`create_date` DATETIME NOT NULL ,
`last_update` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY (`customer_id`) ,
INDEX `idx_fk_store_id` (`store_id` ASC) ,
INDEX `idx_fk_address_id` (`address_id` ASC) ,
INDEX `idx_last_name` (`last_name` ASC) ,
CONSTRAINT `fk_customer_address`
FOREIGN KEY (`address_id` )
REFERENCES `sakila`.`address` (`address_id` )
ON DELETE RESTRICT
ON UPDATE CASCADE,
CONSTRAINT `fk_customer_store`
FOREIGN KEY (`store_id` )
REFERENCES `sakila`.`store` (`store_id` )
ON DELETE RESTRICT
ON UPDATE CASCADE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COMMENT '存储所有客户的表.保存地址表和该客户注册的商店表的外键.\n\n客户的基本信息(如名字和姓氏)存储在表本身中.记录创建日期和信息上次更新时间相同.'
COMMENT 'Table storing all customers. Holds foreign keys to the address table and the store table where this customer is registered.\n\nBasic information about the customer like first and last name are stored in the table itself. Same for the date the record was created and when the information was last updated.'
SQL 脚本执行完成:语句:3 条成功,1 条失败
SQL script execution finished: statements: 3 succeeded, 1 failed
推荐答案
如 MySQL 文档中所述,评论限制为 255 个字符:http://dev.mysql.com/doc/refman/5.1/en/create-table.html#id3411882.您的评论是 305 个字符,从错误消息看来,您的特定 MySQL 安装有 60 个字符的限制.
As stated in the MySQL docs, a comment is limited to 255 characters: http://dev.mysql.com/doc/refman/5.1/en/create-table.html#id3411882. Your comment is 305 characters, and it would seem, from the error message, that your particular MySQL install has a 60 character limit.
这篇关于MySQL:错误 1628:表 'customer' 的注释太长(最大 = 60)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!