MySQL error 1366-incorrect integer value How to solve?

Source: Internet
Author: User

This article mainly introduces the MySQL error 1366-incorrect integer value solution, this article by modifying the default value of the field to solve, the need for friends can refer to the

Because the database server has a lot of databases and small databases, it was originally run on a Windows server. Some time ago due to the computer room server to make adjustments, so I will be in a night of nights on the migration of the database and the foreground application has been adjusted, after the adjustment after the test application can be normal access after I left.

Monday just go to work received feedback: Web site published articles reported as follows error:

The code is as follows:

Insert into Doc_main (Title,typeid,uptime,intro,ifhot,imgurl1,doctype,fileurl1,shunxu,titleurl,qitype) VALUES (' Test ', ', ' 2011-5-30 ', ' Test ', ' 1 ', ', ' 0 ', ', ', ', ', ', ' 279 '

Reason Analysis Process:

At first I thought there was a problem with the database file, but compared to the old and new database files, did not find an exception, the preliminary judgment should be the database application problem, so I then copied the above SQL statement directly on the MySQL server execution, the results are disappointing, reported the following error:

The code is as follows:

[SQL] INSERT INTO Doc_main (Title,typeid,uptime,intro,ifhot,imgurl1,doctype,fileurl1,shunxu,titleurl,qitype) values (' Test ', ', ' 2011-5-30 ', ' Test ', ' 1 ', ', ' 0 ', ', ', ', ', ', ', ' 279 ')

[ERR] 1366-incorrect integer value: ' For column ' Shunxu ' at row 1

After viewing the datasheet, we found that the Shunxu field requires an integer, and the default is null, changing its default value to 0. After restarting the MySQL service, test OK.

Related Article

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.