Mysql error 1366-Incorrect integer value how to solve?

Source: Internet
Author: User

Mysql error 1366-Incorrect integer value how to solve?

This article mainly introduces how to solve the Mysql error 1366-Incorrect integer value. This article solves the problem by modifying the default value of the field. For more information, see

Because this database server stores many databases and all of them are small databases, it initially runs on a windows server. Some time ago, due to the need to adjust the server room, I made adjustments to the database migration and front-end applications on a quiet night, after the adjustment, the test application can be accessed normally, and then I leave.

When I first got to work on Monday, I received feedback: the following error was reported when an article was published on the website background:

The Code is as follows:

Insert into doc_main (title, typeid, uptime, intro, ifhot, imgurl1, doctype, fileurl1, shunxu, titleurl, qitype) values ('test', '13 ', '2014-5-30 ', 'test', '1', '', '0','', '123 ')

Cause analysis process:

At first, I thought it was a problem with the database file, but after comparing the old and new database files, I did not find any exceptions. I initially decided it should be a problem with the database application, so I copied the preceding SQL statement and executed it directly on the mysql server. The execution result was disappointing and the following error was reported:

The Code is as follows:

[SQL] insert into doc_main (title, typeid, uptime, intro, ifhot, imgurl1, doctype, fileurl1, shunxu, titleurl, qitype) values ('test', '13 ', '2014-5-30 ', 'test', '1', '', '0','', '123 ')

[Err] 1366-Incorrect integer value: ''for column 'shunxu 'at row 1

After viewing the data table, it is found that the shunxu field requires an integer, and the default value is null. change its default value to 0. Restart the mysql service and 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.