auto_increment

sdyqingdao 2002-10-14 05:34:24
设置id int(8) not null auto_increment primary key

insert第一个纪录时,发现id的value为:2147483647

究竟为什么?这是该表的第一条纪录啊?
...全文
57 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
shuixin13 2002-10-15
  • 打赏
  • 举报
回复
能不能将你的create table 语句帖出来呀
shuixin13 2002-10-15
  • 打赏
  • 举报
回复
呵呵,
你的情况我没遇过,
也不敢多说了,

2147483647 是7F FF FF FF

INT[(M)] [UNSIGNED] [ZEROFILL]
一个正常大小整数。有符号的范围是-2147483648到2147483647,无符号的范围是0到4294967295。
sdyqingdao 2002-10-15
  • 打赏
  • 举报
回复
bombshell(水中鱼) :
你是怎么插入纪录的?
在id 字段,我用'null',
结果插入第二个纪录出现duplicate key,都是2147483647

sdyqingdao 2002-10-15
  • 打赏
  • 举报
回复
shuixin13(犬犬(心帆)) ,what do the '7F FF FF FF' mean?
sdyqingdao 2002-10-15
  • 打赏
  • 举报
回复
create table author (
id int(8) not null auto_increment primary key,

---------------------


Now I have not any trouble on inserting after I delete all records.

I think the bug occuring when I tried to "insert into author values(,'name'..........)"

thank you ,everyone
phpteam 2002-10-15
  • 打赏
  • 举报
回复
ALTER TABLE tablename AUTO_INCREMENT = 1
后再试试
wykyday 2002-10-15
  • 打赏
  • 举报
回复
可能数据库表结构有问题,
删了重建试试。
sql语句要是没问题那可能就是MySQL的问题了。
sdpong 2002-10-15
  • 打赏
  • 举报
回复
ALTER TABLE tablename AUTO_INCREMENT = 1
后再试试
bombshell 2002-10-14
  • 打赏
  • 举报
回复
没遇到过这种情况,如果自动增加的又是第一条记录是1
shuixin13 2002-10-14
  • 打赏
  • 举报
回复
7F FF FF FF ?
sdyqingdao 2002-10-14
  • 打赏
  • 举报
回复
我的msn messenger:renbenzhuyi@hotmail.com
欢迎交流

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧