-
Notifications
You must be signed in to change notification settings - Fork 0
Conneting to Databases
kirkvanacore edited this page May 24, 2021
·
2 revisions
# load Package
library(DBI)
con <- dbConnect(drv = RMySQL::MySQL(),
host = " ",
port = ,
user = " ",
password = " ",
dbname = " "
)
# this query is a random sample of 50,000
data <- dbGetQuery(con,"
select * from schema.table
")
colnames(data)
on.exit(dbDisconnect(con))
write.csv(data, "data.csv")