Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAUL
2017-03-30 15:24
651 查看
导入sql文件时出错,提示
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
查看表语句
其中把两个timestamp设置为当前时间,不支持,只能设置一个为当前时间,删除其中的一个默认值即可
Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
查看表语句
DROP TABLE IF EXISTS `pro_favorite`; CREATE TABLE `pro_favorite` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', `user_id` int(11) unsigned NOT NULL COMMENT '用户ID', `pro_id` int(11) unsigned NOT NULL COMMENT '商品ID', `status` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '0:取消 1:确认', `favoritetype` tinyint(4) unsigned NOT NULL DEFAULT '1' COMMENT '收藏类型(预留)', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间', `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', PRIMARY KEY (`id`), KEY `fav_userIdx_idx` (`user_id`), CONSTRAINT `fav_userIdx` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='产品收藏';
其中把两个timestamp设置为当前时间,不支持,只能设置一个为当前时间,删除其中的一个默认值即可
相关文章推荐
- msyql同步的时候报错 : 错误代码: 1293 Incorrect table definition;there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- 1293 - Incorrect table definition; there can be only oneTIMESTAMP column with CURRENT_TIMESTAMP
- error : Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in
- mysql单表多timestamp报错#1293 - Incorrect table definition; there can be only one TIMESTAMP column with C
- Mysql 1293 - Incorrect table definition; there can be only one TIMESTAMP column with C
- there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT
- there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- 数据库建表 there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
- [Err] 1293 - there can be only one TIMESTAMP column with CURRENT_TIME in DEFAULT or ON UPDATE clause
- mysql报ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must
- 解决,Incorrect table definition; there can be only one auto column and it must be defined as a key
- ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be def
- 创建主键时报错:ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it mus
- Incorrect table definition; there can be only one auto column and it must be defined as a key
- 1075 - Incorrect table definition;there can be only one auto column and it must be defined as a key
- MySQL错误:Incorrect table definition;there can be only one auto column and it must be defined as a key
- 创建主键时报错:ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it mus