MySQL upgrade from 5.5 to 5.6,timestamp changes

Source: Internet
Author: User

reprinted from Http://blog.csdn.net/ghsau. MySQL upgrade from 5.5 to 5.6,timestamp changesThe behavior of timestamp in MySQL5.5
    • The first timestamp non-null character De Yin default value is not set by default:
      Current_timestamp on UPDATE Current_timestamp
    • The default value of the timestamp not NULL character De Yin is not set in the following format:
      0000-00-00 00:00:00
    • TIMESTAMP The NOT NULL field inserts NULL, an implicit default value is used:
      Current_timestamp
    • Multiple Current_timestamp default values are not supported
The behavior of timestamp in MySQL5.6
    • Supports multiple current_timestamp default values
    • Can be compatible with 5.5 behavior, supporting implicit default values
      • Explicit_defaults_for_timestamp=0
      • I test the installation of MySQL5.6 by default with this parameter, when started, the server will give a warning.
        [Warning] TIMESTAMP with implicit the DEFAULT value is deprecated. Use–explicit_defaults_for_timestamp server option (see documentation for more details).
    • Implicit default values can be removed
      • Explicit_defaults_for_timestamp=1
Summarize
      • Timestamp behavior in MySQL5.5 is more bizarre, causing some hidden problems, such as the passing of a null value in a program
      • Timestamp behavior can be normal in MySQL5.6, but there is a compatibility issue
      • Explicit_defaults_for_timestamp parameter will disappear in the future
      • We do not rely too much on the characteristics of the database, which can cause the application to be constrained

MySQL upgrade from 5.5 to 5.6,timestamp changes

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.