1

I want to connect to a remote MySQL server through SSH in RStudio 1.2 since they announced SQL integration(https://blog.rstudio.com/2018/10/02/rstudio-1-2-preview-sql/).

I can connect to the server using MySQL workbench using standard TCP/IP over SSH with all the SSH and MySQL login info I have. But for RStudio, I didn't have a clear idea where should I put those SSH info. I find this https://www.r-bloggers.com/accessing-mysql-through-r/ from r bloggers and another question Connecting to MySQL from R but the both didn't have the SSH part.

My machine
OS: Windows 10
R: 3.5.3
RStudio: 1.2.1335
RMySQL package installed.

Remote server
OS:ubuntu 16.04LTS
SSH host = myhost.dns.com
SSH port = 222
username = user1
password = password1
MySQL version: 5.7.26
MySQL host = 127.0.0.1
MySQL port = 3306
MySQL username = user2
MySQL password = password2

I found some code like this but there is also no SSH part so RStudio will return error.

con <- DBI::dbConnect(odbc::odbc(),
                        Driver    = "MySQL", 
                        Server    = [My Server],
                        Database  = [My Database],
                        UID       = [My User ID],
                        PWD       = [My Password],
                        Port      = 3306)

Thanks in advance for all the help.

0 Answers0