My MySQL client (Sequel Pro) is set up to connect to Vagrant over SSH. I've setup the following in my ~/.ssh/config
file:
Host vagrant
HostName 127.0.0.1
CheckHostIP no
Port 2222
User vagrant
IdentityFile ~/.vagrant.d/insecure_private_key
Everything works fine if I haven't run vagrant ssh
. But once I've logged into the Vagrant box with that command Sequel Pro can no longer connect via SSH - it just says "The SSH Tunnel has unexpectedly closed." So I have to run vagrant reload
before I can connect to the MySQL server.
Does anyone know how to get around this issue?
Vagrant SSH Once you are done exploring the virtual machine, you can exit the session with CTRL-D.
Command: vagrant destroy [name|id] This command stops the running machine Vagrant is managing and destroys all resources that were created during the machine creation process. After running this command, your computer should be left at a clean state, as if you never created the guest machine in the first place.
I had the same problem, and it turned out to be an old key in my known_hosts
file.
So, I did:
$ vi ~/.ssh/known_hosts
went to the line with 127.0.0.1:2200
on it, then did command dd
to delete that line.:x
to save, and bam bob's yer uncle. Connection granted, long live Jambi.
I hope that saves someone some grief. Cheers.
I got around this issue by using port forwarding instead of SSH tunnelling. I added the following to Vagrantfile
:
config.vm.network :forwarded_port, guest: 3306, host: 8306
Then connected to MySQL via port 8306
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With