Skip to content

Instantly share code, notes, and snippets.

@crittermike
Last active February 2, 2019 20:11
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save crittermike/3503791 to your computer and use it in GitHub Desktop.
Save crittermike/3503791 to your computer and use it in GitHub Desktop.
Import gzipped MySQL DB dump but ignore data from specific tables
# REGULAR VERSION
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | mysql -u root -p databasename
# DRUPAL VERSION
gunzip -c db.sql.gz | grep -Ev "^INSERT INTO \`(cache_|search_|sessions|whatever)" | drush sqlc
@scottalan
Copy link

Nice gist man!!! Thanks Critter

@Arthur447
Copy link

Nice trick thanx

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