I recently installed MySQL on my computer and am trying to connect RStudio to MySQL. I followed instructions in a book as well as instructions here. However, whenever I use dbConnect()
or src_mysql
in RStudio
, I get this error message:
Error in .local(drv, ...) :
Failed to connect to database: Error: Plugin caching_sha2_password could not be loaded: The specified module could not be found
For example, I might login to MySQL using the command prompt in Windows
mysql -u username -p
and create a database as follows
CREATE DATABASE myDatabase;
and then in RStudio:
library(RMySQL)
db <- dbConnect(MySQL(), dbname = "myDatabase", user = "username",
password = "password", host = "localhost")
and my response is always that error message listed above.
And if you need it:
sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)