1

I'm trying to connect to MySQL Workbench using RMySQL:

con <- dbConnect(dbDriver("MySQL"), host="hostName", port = number, user = "user", password = "password",  dbname="dbname")

and I got an error:

Error in .local(drv, ...) : Failed to connect to database: Error: Plugin mysql_clear_password could not be loaded: The specified module could not be found.

I couldn't find anything about that error in RMySQL and I don't know how to solve that problem. Anyone could help?

Shayan Shafiq
  • 1,447
  • 5
  • 18
  • 25
Natalia
  • 375
  • 3
  • 11
  • 1
    Is this error coming from your code or from the MySQL server itself? – tadman Aug 23 '16 at 07:55
  • 1
    Probably from code. I mean I can see it in terminal in R Studio and I don't have any other information about that except for that what I wrote above... :( – Natalia Aug 23 '16 at 08:07
  • 1
    @Natalia Please check the ODBC driver is installed on your computer. May be you could check with local database first before making a connection to remote database. Also please check the following link [here](http://stackoverflow.com/questions/38416714/failed-to-connect-the-database-when-using-sqldf-in-r) – Shiva Prakash Aug 23 '16 at 11:09

1 Answers1

2

Set system environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN = Y:

image

Shayan Shafiq
  • 1,447
  • 5
  • 18
  • 25