, ( 2014, my.cnf) Hadley ( my.cnf NULL), NULL .
, .Rprofile :
src_mysql_from_cnf <- function(dbname,
dir="~/.my.cnf",
host=NULL,
user=NULL,
password=NULL,
...) {
if(!(file.exists(dir)))
stop(sprintf("No such file '%s'",dir))
dplyr::src_mysql(
dbname,
default.file=path.expand(dir),
host=host,
user=user,
password=password,
...)
}
test_db <- src_mysql_from_cnf("test")