Skip to content

Instantly share code, notes, and snippets.

@bennoislost
Last active August 4, 2017 10:23
Show Gist options
  • Save bennoislost/d98d5cf4cb6710a5866a15ecad303c50 to your computer and use it in GitHub Desktop.
Save bennoislost/d98d5cf4cb6710a5866a15ecad303c50 to your computer and use it in GitHub Desktop.
SSH Tunnel to import GZ mysqldump
# with gunzip
gunzip < magento_db.2015-02-18.sql.gz | mysql -u root -p -h 127.0.0.1 -P 13306 magento_db
# or with pv & gzcat - for pipe buffer size display
pv magento_db.2015-02-18.sql.gz | gzcat | mysql -u root -p -h 127.0.0.1 -P 13306 magento_db
ssh -L 13306:localhost:3306 [email protected] -i ../../vagrant/.vagrant/machines/default/virtualbox/private_key
# Expose local port `13306` to remote host `192.168.10.114` port `3306`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment