Search code examples
mysqlsshmysql-workbenchsockssequelpro

MySQL connection through jump server (Sequel Pro or Workbench)


Background: A client's site is hosted externally. Only whitelisted IP addresses can ssh to their server. My company recently moved into a shared space with a dynamic IP. I want to access mysql through sequel pro preferably.

I've set up a jump server and had that IP whitelisted. I can use this to access the shell with a simple tunnel: ssh -t [email protected] ssh -i keylocation [email protected]

I can use a SOCKS proxy with filezilla by opening it with something like: ssh -D 8080 -C -N [email protected] Then set filezilla to connect by SOCKS 127.0.0.1:8080.

Is there any similar method that can be used to connect to MySQL through a client on my local computer (A) going through jump server (B) to access mysql on localhost on the client server (C)?


Solution

  • So the solution to this was port forwarding.

    ssh -t [email protected] ssh -i key [email protected] -L 33060:localhost:3306
    

    Basically what's happening is from my local computer i'm forwarding port 33060 on the jump server to 3306 (mysql port) on the client server.

    If that connection is left open I can connect sequel pro by ssh to the jumpserver and connect to the database on the client server through port 33060.