3

I'd like to use MySql Workbench to browse my database in Vagrant from host machine.

So far I just commented the line bind-address = 127.0.0.1 in my.cnf and all was ok, but recently I connected to a new wi-fi and things seemed to change, I had to change guest ip address from 192.168.0.200 to 192.168.1.200 and I can't open mysql connection from host.

I tryed also to add bind-address = 10.0.2.2 guessing (not sure) this was my host ip but still the same.

What do I need to do?

Thank you

K. Weber
  • 2,643
  • 5
  • 45
  • 77

1 Answers1

7

Define a static ip for your box like in this example:

Vagrant.configure("2") do |config|

      config.vm.network "private_network", ip: "10.0.0.6"

In Mysql Workbench create a new connection over SSH:

Connection Method: Standard TCP/IP over SSH

SSH Hostname: 10.0.0.6 (like above)

SSH Username: vagrant

SSH password: vagrant

MySQL Hostname: 127.0.0.1

MySQL Username: root

MySQL Password: root

SSH Host Key identification:

Instead of a password you can use the box specific Private Key. You can get the path by executing vagrant ssh-config.

smiggle
  • 1,259
  • 6
  • 16
  • This works great in mysql workbench. Unfortunately for me, the mysql excel plugin that i need to use while working on some CSV data does not have the option to connect over SSH. – Moulde Apr 09 '15 at 13:45
  • Host key verification failed. – itsazzad Sep 13 '15 at 15:27