An error occurred when using MySQL 5.x or a later version #1929 Incorrect datetime value: '''' for column ''createtime,

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.