I'm able to connect to my company's MySQL server via SSH in Terminal
ssh -L 3306:localhost:3306 me@jumphost.mycompany.com
mysql -h mysql.mycompany.com -ume -pmy_password
I'm struggling to find a way to do this in an R Script. Any suggestions appreciated.
If I try to connect using DBI (after connecting to ssh in Terminal):
con <- DBI::dbConnect(RMariaDB::MariaDB(),
host = "localhost",
user = "me",
password = "my_password")
I get this error: Error: Failed to connect: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)