Skip to content

Instantly share code, notes, and snippets.

@manboubird
Forked from wardbekker/gist:964146
Last active August 29, 2015 14:25
Show Gist options
  • Save manboubird/c4068eee91449cfcafaa to your computer and use it in GitHub Desktop.
Save manboubird/c4068eee91449cfcafaa to your computer and use it in GitHub Desktop.
Naive parallel import of Compressed MYSQL dump file
# Split MYSQL dump file
zcat dump.sql.gz | awk '/DROP TABLE IF EXISTS/{n++}{print >"out" n ".sql" }'
# Parallel import using GNU Parallel http://www.gnu.org/software/parallel/
ls -rS *.sql | parallel --joblog joblog.txt mysql -uXXX -pYYY db_name "<"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment