When we trying update the scheme of database structure then get error Incorrect datetime value: ‘0000-00-00 00:00:00’ for the column.
Follow Below Steps
- Get SQL_MODE :SHOW VARIABLES LIKE ‘sql_mode’;
Result:
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
- Remove on the result :NO_ZERO_IN_DATE,NO_ZERO_DATE
- Set new configuration :set GLOBAL SQL_MODE=’ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION’
More Stories
How to reset or change the MySQL root password?
MySQL String Functions
Compare comma-separated field with single string