Resetting AUTO_INCREMENT on myISAM without rebuilding the table

Posted by Artem on Stack Overflow See other posts from Stack Overflow or by Artem
Published on 2010-04-21T19:38:45Z Indexed on 2010/04/21 19:43 UTC
Read the original article Hit count: 216

Please help I am in major trouble with our production database. I had accidentally inserted a key with a very large value into an autoincrement column, and now I can't seem to change this value without a huge rebuild time.

"ALTER TABLE tracks_copy AUTO_INCREMENT = 661482981"

Is super-slow.

How can I fix this in production? I can't get this to work either (has no effect): myisamchk tracks.MYI --set-auto-increment=661482982

Any ideas?

Basically, no matter what I do I get an overflow: SHOW CREATE TABLE tracks CREATE TABLE tracks ( ... ) ENGINE=MYISAM AUTO_INCREMENT=2147483648 DEFAULT CHARSET=latin1

© Stack Overflow or respective owner

Related posts about alter-table

Related posts about auto-increment