遇到2次这个问题了:
因为MySQL 5.6以后timestamp设定默认值规则改变,不能为”0000 00-00 00:00:00”;
show session variables like '%sql_mode%';
然后修改sql_mode,去掉NO_ZERO_IN_DATE,NO_ZERO_DATE:
set sql_mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
參考: