报错:
Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘login_time’ at row 1
原因:MySQL5.7对时间处理更加严格了。
尝试了下面的教程不起作用!
https://blog.csdn.net/hemingwang0902/article/details/30483753
最后是这样解决的,在MySQL中执行:
show variables like 'sql_mode';
把NO_ZERO_IN_DATE,NO_ZERO_DATE这两个删掉即可:
set global sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';