Q: Unable to connect to MySQL Database from local RStudio I want to connect to my enterprise MySQL server (APS) from RStudio local IDE. 
However,
 I keep getting the following error message : 

Error in .local(drv, ...) : 
    Failed to connect to database: Error: Unknown MySQL Server Host '' (11001)

I installed and loaded "RMySQL","DBI" and "dbConnect" packages and using the following code (sanitized): 
drv <- dbDriver("MySQL")
dbname <- "DCA-APS-PRD"
user <- "<My_SSO_USERID>"
password <- "<My_SSO_PASSWORD>"
host <- "<prod server ip>"
port <- <prod server port>

con <- dbConnect(drv, user=user, password=password, dbname=dbname, host=host, port=port)

What am I doing wrong?

A: First install the Connector/ODBC on your laptop, you can find it here:
https://dev.mysql.com/downloads/connector/odbc/
Then insert your connection parameters (User, IP, ...) in the connector and test it using the test button. If everything is ok, install the package RODBC in R:
https://cran.r-project.org/web/packages/RODBC/index.html
After that, test the connection, like this:
channel <- odbcConnect("connector", uid="user")
result  <-   paste("select * from table")
table<-sqlQuery(channel, result,error=TRUE)
table

