Jump to content

Update auto_increment Column


pootlecat

Recommended Posts

The problem I have is that I split one massive table into 3 smaller ones and I want the auto_increment column to start from '1' on 'line 1' and increase from there on all 3 tables. I was just hoping there would be some simple command I could do that would recalculate all the auto_increment values for me.
You don't want to do any of this... leave these values alone.  In theory you can just "recalculate" them yourself, and use whatever values you deem appropriate (but unless you can really convince me, I'm not going to tell you how).  Since it sounds like you're just starting out, I'm assuming that nothing is referencing these records via a FK.  The least bad method would be simply to copy the records over to a fresh table without their UID, and let MySQL take care of it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.