Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to Vagrant Box with MySQL Workbench

I'm getting started with Vagrant.

I'm trying to connect to Scotch Box with MySQL Workbench.

First I did succeed to connect to mysql with a PHP script inside the box, but I can't do it with MySQL Workbench.

Here is my Vagrantfile:

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

config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.network "forwarded_port", guest: 3306, host: 3306
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]

I've got the error message: "Could not connect the SSH Tunnel" MySQL Workbench error message

I've edited the file "/etc/mysql/my.cnf" to bind-address = 0.0.0.0

I'm on Windows 10

Thank you very much for helping me, I don't know what's wrong, everything I already read online and tried didn't worked.

like image 415
Antoine Avatar asked Feb 17 '17 10:02

Antoine


People also ask

How do I connect to a local MySQL server using Workbench?

Launch the MySQL Workbench from the desktop. Click the Local instance MySQL80 button, and click Connect to begin the configuration process. When prompted, enter in the MySQL server root password which was created during the MySQL installation process. Optionally, you may check the Save password in vault check box.


1 Answers

I found where was my issue. I wasn't using the right SSH key file...

To find the the location of your key file:

-> Execute vagrant ssh-config in your Vagrant directory.

So my config for this scotch-box:

SSH Hostname: 192.168.33.10

SSH Username: vagrant

SSH Password: vagrant

SSH Key File: your-path-here

MySQL Hostname: 127.0.0.1

MySQL Server Port: 3306

Username: root

Password: root

like image 74
Antoine Avatar answered Oct 11 '22 15:10

Antoine