Skip to content

Instantly share code, notes, and snippets.

@jack2jm
Created November 11, 2020 09:31
Show Gist options
  • Save jack2jm/c0d2489514c9ea5e666152b7c4756a61 to your computer and use it in GitHub Desktop.
Save jack2jm/c0d2489514c9ea5e666152b7c4756a61 to your computer and use it in GitHub Desktop.
// Reset auto increment id
ALTER TABLE tablename AUTO_INCREMENT = 1
// copy new table with indexes (Do not copy data)
CREATE TABLE newtable LIKE oldtable;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment