Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL auto_increment

Status
Not open for further replies.

mrtopher

Programmer
Joined
Aug 27, 2003
Messages
34
Location
US
I am having a problem with a mysql database. It appears that a table in my database has stopped accepting records. I have a column that I am using as my primary key and it is auto_incremented everytime a new record is entered. That number has gotten up to 127 and now it wont allow any new records into the table.

This is the error I am getting:
"Duplicate entry '127' for key 1"

It sounds to me like my auto_increment has stopped incrementing at 127 and wants to repeat itself. Does anyone know what I can do about this?? Any help is greatly appreciated!
 
What is the column type of the auto_increment column? It sounds like you used tinyint, which is only 8 bits. Unless you use tinyint unsigned, 127 will be the maximum value you can store.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
THATS IT!!

I have been trying to fix this problem for a while, and no one could give me an answer.

Thanks a lot!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top