Connecting to database with mysql workbench

Hi,

I have switched to the latest commit of trellis (5cd8c27) and I am issues connecting to my database via mysql workbench (version 6.3)

I have refenced Ben’s guide: https://roots.io/trellis/docs/database-access/ and followed some guidelines left in previous topics in the discourse (Cannot connect to MySQL and Sequel pro + ssh to vagrant) but I am not having much luck.

The error message that I receive is: Could not connect the SSH tunnel. Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details.

When I check the log file, the same error message is repeated with no more details which is quite unhelpful.

That being said, I think the issue the error shows the problem is connecting via ssh and not the mysql login details.

I have tried using both the IP address with port number (:22) and the domain with port number. I have also tried using the preferred ssh port number (:2222) with both of these details.

I am also using the default username and password (vagrant) and have added these credentials to the vagrantfile (using config.ssh.username and config.ssh.password) along with the private key held within the trellis installation as the ssh key file.

However, none of these solutions have worked so far. I am able to ssh into the VM using the command vagrant ssh via git bash, but I would like to be able to connect vai mysql workbench if possible.

Any help regarding this issue would be greatly appreciated.

Kind regards

Darren

When you say default vagrant password, what are you referring to?

You shouldn’t need to use a password, instead just the private key as described in the Trellis docs.

ah sorry, I meant vagrant as well. This was a default option in an earlier version of trellis. I neglected to mention that I also tried with the username vagrant, without a password and with the private key but this also returned the same error.

There was a small regression which was fixed a few days ago. Make sure you have this change: https://github.com/roots/trellis/pull/764

@dconyard did the connection succeed prior to updating Trellis?

After you’ve verified you have the change @swalkinshaw mentioned, don’t forget to reprovision in order to apply the change: vagrant provision

If at that point the connection still doesn’t work, you could try adding this to group_vars/all/main.yml:

sshd_allow_tcp_forwarding: true

Then reprovision again: vagrant provision

Thanks for responding so quickly @nathobson @swalkinshaw @fullyint

The trellis installation was working prior to the update. Im not at my computer right now, but i will try again tomorrow :grinning:

I added the change from @swalkinshaw and re-provisioned the VM and I also tried the solution from @fullyint and re-provisioned the VM but unfortunately these solutions did not solve the issue and the error message still states:

Could not connect the SSH tunnel. Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details.

is there any other information that would help to diagnose this issue?

I have the same issue and tried this solution as well without any luck.
ssh vagrant to the machine works fine.

Hi Fabian,

Sorry, I figured this out about two weeks ago and I forgot to update this ticket. I found out this is to do with a flaw in mysql workbench 6.3. Even though when you open the application and check for updates it states that you are on the latest version when really you are not. Go to the workbench website, and update to the latest version.

The reason why it fails is to with an open ssh compatibility flaw between vagrant and the open ssh protocols that mysql workbench provides. Upgrade to the latest version and it should solve your issue, very loosely the background of the connection panel was dark blue in the old version and it should be white in the newer version :slight_smile:

Let me know how you get on

2 Likes

Thanks for that tip! Still on Workbench 6.3.10 for …reasons, but works fine in sequel pro.