mysql8.0报错 Incorrect datetime value

mysql8.0报错:Incorrect datetime value: '0000-00-00' for column
my.cnf中添加一行(消除datetime为空时报错):

sql_mode=NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION  

然后service mysqld restart