Skip to content

Instantly share code, notes, and snippets.

@nikolazic
Created February 21, 2017 19:26
Show Gist options
  • Save nikolazic/d4596d59f5cc331c2018a54c776e1cde to your computer and use it in GitHub Desktop.
Save nikolazic/d4596d59f5cc331c2018a54c776e1cde to your computer and use it in GitHub Desktop.
Exclude certain data from MySQL DB Dump
# Find out tha start and end for each table data and definition
grep -n 'Table structure\|Dumping data for table' superatv_prod-FULL-20170221.sql
...
406:-- Table structure for table `avatax_log`
429:-- Dumping data for table `avatax_log`
1361:-- Table structure for table `avatax_queue`
...
sed '429,1361 d' dump.sql > cleandump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment