An error occurred when using MySQL 5.x or a later version #1929 Incorrect datetime value: '''' for column ''createtime,
After MySQL is installed, an error message indicating #1929 Incorrect datetime value: ''for column 'createtime' is always displayed when saving and deleting table data. As a result, the table data cannot be deleted;
Cause analysis:
5. For Versions later than 5, if the time period is NULL, NULL should be written;
The official explanation said: I learned that the new mysql version has a "bug" for null insertion ",
Remove the enable strict SQL mode selected by default when installing mysql.
So what if we have installed mysql? The solution is to change the configuration of my. ini in mysql.
Solution:
Modify the my. ini configuration file. We recommend that you back up the file before modification,
Search for SQL-mode in my. ini,
My MySQL version is 5.7.9. The default value is:
SQL-mode = "STRICT_ALL_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_ZERO_DATE, NO_ZERO_IN_DATE, NO_AUTO_CREATE_USER"
Delete the NO_ZERO_DATE and NO_ZERO_IN_DATE marked in red and save and restart mysql;
If the version is low, the default value may be:
The default value is SQL-mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ",
Delete the STRICT_TRANS_TABLES marked in red and save and restart mysql;
The preceding section describes how to use MySQL 1929 or a later version to report an error # Incorrect datetime value: '''' for column ''createtime, I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!