Mysql versions later than 5.0.17 deal with ''and null _ MySQL

Source: Internet
Author: User
Mysql versions later than 5.0.17


Mysql versions later than 5.0.17 deal with ''and null

After MySQL is upgraded to 5.0.17, execute the SQL statement

Insert INTO 'table name' () VALUES ();

Error:

#1264-Out of range value for column ''at row 1

Cause: The new MySQL version strictly checks fields. (Auto_increment is used)

Solution:

Modify my. ini and set

SQL-mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION"

Change

SQL-mode = "NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ".

Restart MySQL.

In Linux, change/etc/my. cnf, and there may be no SQL-mode,

You can add SQL-mode = "NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION" under [mysqld"

Use mysql> SELECT @ SQL _mode; to query the current mode.

BitsCN.com

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.