ERROR 1292 (22007): Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘date’ at row 87103

We got error while altering a table in mysql

The issue was due to strict mode enabled in Mysql

You can check if mysql strict mode is checked using below command

# mysql

mysql> SELECT @@sql_mode;

If you see statement

+———————————————————————————————————————–+
| @@sql_mode |
+———————————————————————————————————————–+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+———————————————————————————————————————–+
1 row in set (0.01 sec)

To disabled it

open fie /etc/my.cnf

Add in below of file sql_mode=” “

and restart mysql

This will disable strict mode in mysql

Alter command works fine now