Here's a situation:
I do all my work on a Mac. I have mysql installed on my mac.
-
There's a certain linux server 'server01' that provides access to
another linux server 'server02' via a pseudo terminalSo, to ssh into 'server02', I do this from my mac:
``` ssh -t server01 'inline server02' ```
-
Then it asks me for a password to 'server01'; I enter it and that
logs me into 'server02'. Now, I am on the 'server02' terminal. -
From 'server02' I can access the mysql database that is sitting on
'server03' using the following mysql command:``` mysql --host=server03 --port=4201 --user=myuser --password=mypass mydb ```
-
Neither 'server01' nor 'server02' or my mac have SSH access to 'server03'
Now, I want to access the mysql on 'server03' from my mac directly through some kind of port forwarding. So, if I type the below command on my mac terminal, it should connect me to the mysql database on 'server03':
``` mysql --host=localhost --port=4201 --user=myuser --password=mypass mydb ```
Is there a way to do that? Any help is greatly appreciated.