[Warning]? Timestamp?with?implicit? default?value?is?deprecated

Source: Internet
Author: User
Tags deprecated

As indicated by the warning, to turn off the nonstandard behaviors, enable the new Explicit_defaults_for_timestamp system Variable at server startup. With this variable enabled, the server handles TIMESTAMP as follows instead: The warning that is displayed, turns off non-standard behavior so that the new explicit_defaults_for_ The timestamp system variable is enabled when the server starts, and the server processes the timestamp as follows:
TIMESTAMP columns not explicitly declared as NOT NULL permit null values. Setting such a column to NULL sets it to NULL, not the current timestamp. The timestamp column is not explicitly declared as NOT NULL, which allows null values. Set upsuch a columnNULL to set it to null, not the current timestamp.
No TIMESTAMP column is assigned the DEFAULT current_timestamp or on UPDATE current_timestamp attributes automatically. Those attributes must be explicitly specified.does not automaticallySpecify default timestampcolumn Current_timestamp or update Current_timestamp property. These properties must be explicitly specified.
TIMESTAMP columns declared as not NULL and without an explicit default clause is treated as having no DEFAULT value. For inserted rows This specify no explicit value for such a column, the result depends on the SQL mode. If Strict SQL mode is enabled, an error occurs. If Strict SQL mode isn't enabled, the column is assigned the implicit default of ' 0000-00-00 00:00:00 ' and a warning OCCU Rs. This is similar to how MySQL treats other temporal types such as DATETIME.TIMESTAMPThe column is declared as not NULL, and no explicit default value is considered to be not. Specifies a column with no explicit values for the inserted row, and the result depends on SQL mode. An error occurs if SQL mode is enabled Strictly. If strict SQL mode is not enabled, column assignment implies the default value of "0000-00-00," and a warning occurs. This is similar to how MySQL treats other temporal types such as DateTime.

Modify My.ini [mysqld] Add explicit_defaults_for_timestamp=true

From for notes (Wiz)

[Warning]? Timestamp?with?implicit? default?value?is?deprecated

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.