[ERR] 1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
createTime timestamp default CURRENT_TIMESTAMP null comment '创建时间',
updateTime timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
报这个的原因是MySQL版本是5.5.X,版本太低,不支持在一张表中有两个timestamp类型数据。
只要重新下载高版本数据库就可以解决。
原因是当你给一个timestamp设置为on updatecurrent_timestamp的时候,其他的timestamp字段需要显式设定default值
但是如果你有两个timestamp字段,但是只把第一个设定为current_timestamp而第二个没有设定默认值,MySQL能成功建表,但是反过来就不行…
修改:
createTime datetime default CURRENT_TIMESTAMP null comment '创建时间',
updateTime datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
详细了解请看我之前的一篇文章
Mysql中的日期与时间类型