vscode-mysql
vscode-mysql copied to clipboard
FR: SSH Tunnel Support
It would be great if I could use the extension with an ssh tunnel to vagrant.
Hi @bm-stschneider , could you share more details about how you want to connect MySQL with SSH tunnel. I am not familiar with that, but I find there is a solution to make you able to connect MySQL through general connection option: https://stackoverflow.com/a/18374012/4545351.
Just like here where you can configure the tunnel in the connection setting.
Got that. Thanks for the detailed info.
I'd love this too
yep. in mysql workbench and in many other tools it exist.
The perfect set would be to use the native ssh client instead a reimplementation (so if you use a key, the ssh agent will open it for you), if possible
Would this help: https://www.npmjs.com/package/ssh2 ?
Used by https://github.com/liximomo/vscode-sftp/ whick works really well in VSCode on both Linux and Windows (not tried Mac OS)
In the meantime you can just setup an ssh tunnel manually. Open a terminal and
ssh -N -L 3306:127.0.0.1:3306 ssh-user@remoteserver
And put 127.0.0.1
as address in the connection profile.
EDIT: Sorry for the duplicate .. just saw this solution has been added as a second post.
Any progress for this FR?
Agree, would have me switching from MySQL Workbench and DBeaver.
This case hasn't been updated in a while. I'm running into a related problem while trying to get tunneling to work. I have an ssh proxy via command line that works (successful mysql connection):
$ ssh <proxy-username>@<proxy-host> -L 3306:<db-host>:3306 -N
$ mysql -h 127.0.0.1 -u <db-username> -p
but when I try to use this extension with 127.0.0.1 and my db-username, it comes back with
Error: ER_ACCESS_DENIED_ERROR: Access denied for user '<db-username>'@'<proxy-host-ip>' (using password: YES
So it looks like the tool is doing some kind of ip lookup instead of passing the params directly. Any ideas/help?
Will using this package help?
https://www.npmjs.com/package/mysql-ssh
My fork is support ssh tunnel https://github.com/cweijan/vscode-mysql
@cweijan Cool, can you publish it on the marketplace then?
@bm-stschneider https://marketplace.visualstudio.com/items?itemName=cweijan.vscode-mysql-client it's published.
Is this still a WIP? I could see that the current version has the toggle for SSH tunnel and inputs but it is not able to read my private key.
I see the below error when connecting. The same private key and config works perfectly for Mysql Workbench.