所出错形式如下:
Discuz! info: MySQL Query Error
User: 爱我荆门
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, lastposter, displayorder, digest, blog, special, attachment, subscribed, moderated, supe_pushstatus)
VALUES ('64', '0', '0', '0', '0', '爱我荆门', '5', 'fg', '1173063640', '1173063640', '爱我荆门', '0', '0', '0', '0', '0', '0', '0', '0')
Error: Duplicate entry '8181' for key 1
Errno.: 1062
Similar error report has beed dispatched to administrator before.
之后打开了MYSQL手册找到了TINYINT和SMALLINT和INT类型的说明:
TINYINT[(M)] [UNSIGNED] [ZEROFILL]
一个很小的整数。有符号的范围是-128到127,无符号的范围是0到255
SMALLINT[(M)] [UNSIGNED] [ZEROFILL]
一个小整数。有符号的范围是-32768到32767,无符号的范围是0到65535。
MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]
一个中等大小整数。有符号的范围是-8388608到8388607,无符号的范围是0到16777215。
INT[(M)] [UNSIGNED] [ZEROFILL]
一个正常大小整数。有符号的范围是-2147483648到2147483647,无符号的范围是0到4294967295。
INTEGER[(M)] [UNSIGNED] [ZEROFILL]
这是INT的一个同义词。
BIGINT[(M)] [UNSIGNED] [ZEROFILL]
一个大整数。有符号的范围是-9223372036854775808到9223372036854775807,无符号的范围是0到
18446744073709551615。
原来如此!
那网上其它的Invalid Query : Duplicate entry ‘32767′ for key 1出错的原因也在于此了!
现在找到办法了台升级数据库
ALTER TABLE `cdb_posts` CHANGE `pid` `pid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AUTO_INCREMENT;