I would like to access a MySQL database using dplyr
without having to store my database passwords in plane text R code. Hence, I'd prefer to reference my .my.cnf
file, but since the src_mysql has default parameters for host, user, and password, the only way I can find to to to so is via the rather in-elegant:
test_db <- src_mysql("test",
default.file=path.expand("~/.my.cnf"),
host=NULL,
user=NULL,
password=NULL)
Is there a less verbose way to connect to a MySQL database from dplyr
via stored credentials?