I (Local Z) do data analysis on a remote server (Server A), and I need to connect to a database (Database D) on another remote server (Server B).
I can connect to Database D by SSH tunneling to Server B from Local Z.
However, I run RStudio Server on Server A, and I need to connect to Database D within RStudio on Server A.
How can I go about SSH tunneling from Server A to Server B and connecting to MySQL within RStudio?
EDIT: I'm using the RMySQL package to connect to the database within RStudio. Database D also only allows local connections, so SSH tunnel is required.