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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.