问题
以前MySQL创建表的的时候,timestamp类型的字段可以不加默认值。
createTime timestamp COMMENT '创建时间',
这样创建是没有问题的。但是现在却报错,“Invalid default value for ‘createTime’”
问题原因:因为MySQL 5.6以后timestamp设定默认值规则改变,不能为0000 00-00 00:00:00
查看网上解决方案是修改mysql安装目录下的my.ini文件。但是我不想改mysql配置。
解决方案
createTime timestamp NULL COMMENT '创建时间',
return_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '返回时间',
Warning: Use of undefined constant ‘标签:’ - assumed '‘标签:’' (this will throw an Error in a future version of PHP) in
/home/wwwroot/maotouyingcc.com/wp-content/themes/dux/single.php on line
53
Warning: Use of undefined constant ” - assumed '”' (this will throw an Error in a future version of PHP) in
/home/wwwroot/maotouyingcc.com/wp-content/themes/dux/single.php on line
53
Warning: Use of undefined constant ” - assumed '”' (this will throw an Error in a future version of PHP) in
/home/wwwroot/maotouyingcc.com/wp-content/themes/dux/single.php on line
53
‘标签:’
技术教程”
最新评论
收藏了,以后可能会用到
你们创作的校园二手交易平台和之前的有什么区别有什么区别
论文要求springMVc,这个可以用吗
公众号关注不了,微信二维码太小扫不到
兄弟想要系统可以发给我吗
代码讲解视频有吗
奈斯
这个有论文文档吗