Solve Incorrect integer value: for column id; at row 1

Source: Internet
Author: User

When using mysql to insert data, the system prompts to solve the Incorrect integer value: for column id; at row 1 error. Let's take a look at the solution to this problem.

I recently wrote a query insert statement as follows:

Insert into test values (", row [contentid], '". tn ."');

After the result is inserted, mysql_error () is reported. Incorrect integer value: "for column 'id' at row 1. Generally, we think there should be no error. Later, I checked MYSQL information. It is found that versions above 5 should be NULL if they are NULL.

This problem is generally mysql 5. I used mysql5.1 on x. The official explanation said: I learned that the new mysql version has a "bug" for inserting null values. I need to remove the enable strict SQL mode selected by default when installing mysql, so what if we have installed mysql? The solution is to change the configuration in mysql. ini

Search for SQL-mode in my. ini. The default value is: SQL-mode = "STRICT_TRANS_TABLES, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION" and change it

SQL-mode = "NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION ",

After you restart mysql, what if it is a virtual host or a space. If you can let the Space Provider help you change it, it is the best, if not, then you can only change the program. Both are standardized. Replace null with null.

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.