SSH/Tunnel to database fails
Did something change recently with either port forwarding / tunneling, or anything that would prevent connecting to a database inside of Coder with TablePlus or SQL Pro Studio?
From what I can tell we haven't changed anything in a while, but suddenly none of our connections to Coder work in any desktop database tool.
They all got a little wonky when Coder felt like breaking all the ~/.ssh/config stuff but eventually we got around that... now it just fails for us again.
It's weird, we can open the port using
coder port-forward $1 --tcp 2222:22
which allows things like Tinkerwell to connect to Coder still, but every database tool fails.
Just making sure nothing surprise changed with Coder in the last couple weeks again to try to eliminate one area of debugging lolSolution:Jump to solution
I think its something to do with our mysql being only accessible through
mysql
container name and not 127.0.0.1
inside the image.
I ended up fixing connecting our tools to it with a terminal function
```shell
function tunnel-sql() {...4 Replies
What are you creating this issue for?
Solution
I think its something to do with our mysql being only accessible through
mysql
container name and not 127.0.0.1
inside the image.
I ended up fixing connecting our tools to it with a terminal function
This makes it so things work a little more like they used toah yeah that totally makes sense
so, either you want to run MySQL inside the main container (either via Docker in Docker or just plain MySQL)
or, you can use the
network_mode
with a container:
type so both containers share the same localhost, and therefore ports are available as if it were local (see https://discord.com/channels/747933592273027093/1288479155976933478/1298640103555600384) for an example
(another thing you could do is deploy an agent in your MySQL container and connect through that, but that's not great)