Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save eddydarell/75ba977ce4aecb5a436d4e3e8283a39e to your computer and use it in GitHub Desktop.

Select an option

Save eddydarell/75ba977ce4aecb5a436d4e3e8283a39e to your computer and use it in GitHub Desktop.

Do a regular data dump with mysqldump or using a tool like MySQL Workbench and then run the command bellow to remove the primary key:

sed -i '' "s/([0-9]*,/(NULL,/gi" dump.sql    

Useful when trying to appends data from an SQL export file of a table with the same structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment