FAST SOLUTION FOR ERROR 1929 Incorrect datetime value:'''for column''createtime'' WITH Mysql5.x UP

  • 2021-06-29 12:16:36
  • OfStack

After my MySQL installation, there is always an error alert #1929 Incorrect datetime value:''for column'createtime', which prevents deleting table data;

Reason analysis:

Versions above 5 should write NULL if period time is null;

The official explanation is that the new version of mysql has "bug" inserted for null values.

To remove the default checked enable strict SQL mode when installing mysql

So what if we have mysql installed, the solution is to change the configuration of my.ini in mysql

Resolvent:

To modify the my.ini configuration file, it is recommended that you make a new backup before modifying it.

Find sql-mode in my.ini,

My MySQL version is 5.7.9, defaulting to:

sql-mode="STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"

NO_labeled redZERO_DATE, NO_ZERO_IN_DATE, delete the save and restart mysql;

If the version is low, the default may be:

Default is sql-mode="STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ",

STRICT_labeled redTRANS_TABLES, delete the save and restart mysql;


Related articles: