• Welcome to Simple Machines Community Forum. Please login or sign up.

Database problem, autoincrement value is wrong, how to I fix it?

Started by Deprecated, August 28, 2008, 09:41:50 AM

Previous topic - Next topic


I'm working on a database where the smf_messages autoincrement value is wrong. The table has about 500,000 messages but the autoincrement is something like 4,000,000,000. :)

I figured there was some way in phpMyAdmin to just change it, but looking over the structure I can see no links to edit it. I believe I know what the correct number is, exactly, but how do I repair this problem? Even better, is there an automatic repair operation that will determine the correct value automatically and fix it rather than me inserting what I think the right value is?


What I use for topics, boards, cat.

Not sure if this helps any.


It looks right but I executed it, phpMyAdmin said the operation succeeded, but nothing changed. Here's what I entered:

ALTER TABLE smf_messages AUTO_INCREMENT = 500000

I forget the correct number but it was around the number above and I'm sure I know better than the database what the next value should be. The huge number in the database is surely wrong and I have no doubts.

The only question is how to fix the damned number!

Nevermind. I figured out how to change the number from phpMyAdmin. You click the operations tab and the number can be changed from that screen.