Cannot connect to MySQL databases through SSH tunneling
I have various connection to databases using SSH tunneling but dbee doesn't seem to be able to connect to them.
If I use this connection string: "root:pass@tcp(127.0.0.1:5000)/database" It fails with error c.db.Conn: Error 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) It somehow changed the 127.0.0.1 to localhost which is not correct.
But if I change it to "root:[email protected]:5000/database" It fails with error adapters.NewConnection: core.NewConnection: adapter.Connect: unable to connect to mysql database: default addr for network '127.0.0.1:5000' unknown
There's nothing that I can do to make this work therefore I cannot use this plugin...
I donot know if this is related to my issue but I cannot connect to any mysql database, I have tried adding it in every way, can someone share an example persistance.json with mysql connections in them?
For me they never show up in the sidebar.
also having this issue
Just for future reference if anyone else is having this issue. What I've done is in my neovim config is on the VimEnter event, I call vim.uv.spawn('ssh', .......) which opens the ssh tunnel in a background process, that way with dbee I can just ignore anything specific to ssh and connect to the database directly, having been using this setup for a number of months and is working nicely.
For reference here is the dbee.lua file in my config.
thanks for sharing. Inspecting your configuration I don't understand how a SSH tunnel created with command ssh -N ous-staging without port forwarding can route traffic from local nvim to remote SQL server.
I can only think about setting up LocalForward in ~/.ssh/config but maybe there's another way
Yeah so in my ~/.ssh/config I have the following as an example:
Host ous-staging
User $username
HostName $hostname
Port $port
IdentityFile $pathToPemFile
LocalForward $port $url:$remotePort
Actual values obfuscated of course. Let me know if you have any other questions, happy to help!
i cant even connect to my local mysql same error is there. is there any workaround?