Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oliverlundquist/ba8a0e85bbb0a8c4707ee33b815e5138 to your computer and use it in GitHub Desktop.
Save oliverlundquist/ba8a0e85bbb0a8c4707ee33b815e5138 to your computer and use it in GitHub Desktop.
Database Dump
ssh -i ~/.vagrant.d/insecure_private_key 192.168.100.109 '
HOST='0.0.0.0'
USERNAME=root
PASSWORD=root
DATABASE=mystore2
TABLES='mysql --host=$HOST --user=$USERNAME --password=$PASSWORD --database=$DATABASE --batch --silent --execute \'SHOW TABLES LIKE \'chips_%\'\''
mysqldump --host=$HOST --user=$USERNAME --password=$PASSWORD --no-data $DATABASE $TABLES
' > test.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment