A quick solution to the error #1929 Incorrect datetime value: '''' for column ''createtime'' when using MySQL 5.x or above

A quick solution to the error #1929 Incorrect datetime value: '''' for column ''createtime'' when using MySQL 5.x or above

After I installed MySQL, when I tried to save and delete table data, I always got an error message #1929 Incorrect datetime value: '' for column 'createtime', which prevented me from deleting the table data.

Cause Analysis:

For versions above 5, if the period time is a null value, NULL should be written;

The official explanation is: It is known that the new version of MySQL has a "bug" in inserting null values.

To remove the default check of enable strict SQL mode when installing MySQL

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

Solution:

Modify the my.ini configuration file. It is recommended to make a new backup before modifying it.

Find sql-mode in my.ini,

My MySQL version is 5.7.9, the default is:

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

Delete the red marked NO_ZERO_DATE, NO_ZERO_IN_DATE , save and restart MySQL;

If the version is low, the default may be:

The default is sql-mode=" STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION ",

Delete the red marked STRICT_TRANS_TABLES , save and restart MySQL;

The above is a quick solution to the error #1929 Incorrect datetime value: '''' for column ''createtime'' that occurs when using Mysql5.x or above. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • A brief discussion on the problem of forgotten mysql password and login error
  • Summary of online MYSQL synchronization error troubleshooting methods (must read)
  • How to solve the mysql error 1033 Incorrect information in file: 'xxx.frm'
  • Windows cannot start MySQL service and reports error 1067 solution
  • Solution to MySQL 5.7 group by new feature error 1055
  • ERROR 1045 (28000): Access denied for user ''''root''''@''''localhost''' (using password: YES) Practical solution

<<:  Setting up shadowsocks+polipo global proxy in Linux environment

>>:  Native js implements custom scroll bar component

Recommend

MySQL partitioning practice through Navicat

MySQL partitioning is helpful for managing very l...

Detailed explanation of JavaScript axios installation and packaging case

1. Download the axios plugin cnpm install axios -...

Implementation example of react project from new creation to deployment

Start a new project This article mainly records t...

Detailed explanation of the seven data types in JavaScript

Table of contents Preface: Detailed introduction:...

Example analysis of the page splitting principle of MySQL clustered index

This article uses an example to illustrate the pa...

VMware ESXi installation and use record (with download)

Table of contents 1. Install ESXi 2. Set up ESXi ...

JavaScript Basics Objects

Table of contents 1. Object 1.1 What is an object...

W3C Tutorial (6): W3C CSS Activities

A style sheet describes how a document should be ...

Practical experience of implementing nginx to forward requests based on URL

Preface Because this is a distributed file system...

React implementation example using Amap (react-amap)

The PC version of React was refactored to use Ama...

Windows 10 is too difficult to use. How to customize your Ubuntu?

Author | Editor Awen | Produced by Tu Min | CSDN ...

Method of using MySQL system database for performance load diagnosis

A master once said that you should know the datab...

A simple way to restart QT application in embedded Linux (based on QT4.8 qws)

Application software generally has such business ...

What to do if you forget your mysql password

Forgot your MySQL password twice? At first I did ...