MySQL appears error:duplicate entry "xxxx" for key 1 solutions

Source: Internet
Author: User
Tags mysql manual mysql query

The error is as follows:
discuz! Info:mysql Query Error

User: Love Me Jingmen
Time:2007-3-5 11:00am
Script:/bbs/post.php

Sql:insert into Cd12sb_threads (FID, readperm, Price, iconID, typeID, author, Authorid, subject, Dateline, Lastpost, last Poster, Displayorder, Digest, blogs, special, attachment, subscribed, moderated, supe_pushstatus)
VALUES (' 64 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' Love Me Jingmen ', ' 5 ', ' FG ', ' 1173063640 ', ' 1173063640 ', ' Love Me Jingmen ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ', ' 0 ' , ' 0 ')
Error:duplicate entry ' 8181 ' for key 1
Errno.: 1062

Similar error has beed dispatched to administrator before.

The MySQL manual was then opened and a description of the tinyint and smallint and int types was found:
tinyint[(M)] [UNSIGNED] [Zerofill]
A very small integer. The signed range is 128 to 127, and the unsigned range is 0 to 255.
smallint[(M)] [UNSIGNED] [Zerofill]
A small integer. The signed range is 32768 to 32767, and the unsigned range is 0 to 65535.
mediumint[(M)] [UNSIGNED] [Zerofill]
A medium sized integer. The signed range is 8388608 to 8388607, and the unsigned range is 0 to 16777215.
int[(M)] [UNSIGNED] [Zerofill]
A normal size integer. The signed range is 2147483648 to 2147483647, and the unsigned range is 0 to 4294967295.
integer[(M)] [UNSIGNED] [Zerofill]
This is a synonym for int.
bigint[(M)] [UNSIGNED] [Zerofill]
A large integer. The signed range is 9223372036854775808 to 9223372036854775807, and the unsigned range is 0 to
18446744073709551615.
I see!
That's why other online invalid query:duplicate entry ' 32767′for key 1 went wrong!

Now we got a way. Upgrade database

ALTER TABLE ' cdb_posts ' change ' pid ' pid ' INT (a) UNSIGNED not NULL DEFAULT ' 0 ' auto_increment;

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.