Skip to content

Instantly share code, notes, and snippets.

@delineas
Last active March 30, 2016 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delineas/79b641d673a94e53fc06 to your computer and use it in GitHub Desktop.
Save delineas/79b641d673a94e53fc06 to your computer and use it in GitHub Desktop.
SSH Tunnel Mysql Vagrant
ssh -N -L 3306:127.0.0.1:3316 -p 2222 -i ~/.vagrant.d/insecure_private_key vagrant@127.0.0.1
mysql -u root -proot -P 3316 -h 127.0.0.1
# Alternative
ssh -N -L 3317:127.0.0.1:3306 vagrant@VAGRANT_HOST -i /FOLDER/TO/VAGRANT/.vagrant/machines/default/virtualbox/private_key
mysql -u root -proot -P 3317 -h 127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment