Connecting to MySQL is made very easy with the RMySQL package. To connect to a MySQL database simply install the package and load the library.
install.packages("RMySQL")
library(RMySQL)
Connecting to MySQL:
Once the RMySQL library is installed create a database connection object.
You need to create a user on the remote MySQL and GRANT ALL PRIVILEGES ON to that database. And in place of host put remote machine IP.
mydb = dbConnect(MySQL(), user='user', password='password', dbname='database_name', host='host')
install.packages("RMySQL")
library(RMySQL)
Connecting to MySQL:
Once the RMySQL library is installed create a database connection object.
You need to create a user on the remote MySQL and GRANT ALL PRIVILEGES ON to that database. And in place of host put remote machine IP.
mydb = dbConnect(MySQL(), user='user', password='password', dbname='database_name', host='host')
Comments
Post a Comment