Incorrect datetime value: '0000-00-00 00:00:00' for column 'hr519799901' at row 1

Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘hr519799901’ at row 1@TOC

问题解决方法

问题出在了sql_mode上。运行下面语句即可修改sql_mode。

select @@sql_mode;

SET GLOBAL sql_mode=‘ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’;

set sql_mode=(select replace(@@sql_mode,
‘NO_ZERO_IN_DATE,NO_ZERO_DATE’,’’));

你可能感兴趣的:(sql)