SET SQL _MODE = & quot; NO_AUTO_VALUE_ON_ZERO & quot;

Source: Internet
Author: User


SET SQL _MODE = "NO_AUTO_VALUE_ON_ZERO" NO_AUTO_VALUE_ON_ZERO affects the processing of the AUTO_INCREMENT column. Generally, you can insert NULL or 0 to this column to generate the next serial number. NO_AUTO_VALUE_ON_ZERO disables 0, so only NULL can generate the next serial number. This mode is useful if the result is to save 0 to the AUTO_INCREMENT column of the table. (This Convention is not recommended ). For example, if you use mysqldump to dump a table and reload the table, MySQL generates a new serial number when it encounters a value of 0. The contents of the generated table are different from those of the dump table. Enable NO_AUTO_VALUE_ON_ZERO before reloading the dump file to solve this problem.

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.