2011
11.08

While installing RMySQL on OS X and Linux is really simple this is not the case for Windows. After trying several how to’s RMySQL still wasn’t working. Then I started experimenting my self… With success!

This is what I did:

  • Install R 2.14
  • Install R tools (2.14) (with modifying path option)
  • Install MySQL (5.5.17) (with modifying path option)
  • Create the file Renviron.site in the folder C:\Program Files\R\R-2.14.0\etc and add:

    MYSQL_HOME=C:/Program Files/MySQL/MySQL Server 5.5
    
  • Copy libmysql.lib and libmysql.dll from

    C:\Program Files\MySQL\MySQL Server 5.5\lib to
    C:\Program Files\MySQL\MySQL Server 5.5\lib\opt (must be created)

  • Copy libmysql.dll from
    C:\Program Files\MySQL\MySQL Server 5.5\lib to
    C:\Program Files\R\R-2.14.0\bin\i386
  • Open R and install RMYSQL

    install.packages('RMySQL', type = 'source');
    

If everything went well you’ll now be able to load the RMySQL package by invoking:

library(RMySQL);

in R.

Resources:

No Comment.

Add Your Comment