Connecting to Vagrant Box with MySQL Workbench
Asked Answered
M

2

6

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.

Muskellunge answered 17/2, 2017 at 10:43 Comment(0)
M
17

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

Muskellunge answered 17/2, 2017 at 14:49 Comment(0)
D
0

For developers using puphpet

Choose Standard TCP/IP over SSH

Parameters (Mostly default values since I did not change it)

SSH Hostname: 192.168.56.101
SSH Username: vagrant
SSH Password: vagrant
SSH Key File: C:\cygwin64\home\(username)\puphpet\sutfva\puphpet\files\dot\ssh\id_rsa
MySQL Hostname: 127.0.0.1
MySQl Server Port: 3306
Username: root
Password: 123
Decoupage answered 14/4, 2019 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.