Skip to content

Instantly share code, notes, and snippets.

@kaznovac
Last active October 9, 2017 13:04
Show Gist options
  • Save kaznovac/db3350cf54f671c3616de5bafd684262 to your computer and use it in GitHub Desktop.
Save kaznovac/db3350cf54f671c3616de5bafd684262 to your computer and use it in GitHub Desktop.
import gzipped sql to mysql with progress tracking
#!/usr/bin/env bash
SQL_DATA=database_data.sql.gz
if [ -f "${SQL_DATA}" ]; then
echo "Importing data: ${SQL_DATA}"
pv ${SQL_DATA} | gunzip | mysql -u root -p schema
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment