Using MySQL in R for Windows

前端 未结 3 1188
孤城傲影
孤城傲影 2020-12-05 03:24

How to use MySQL in R (statistic language) for Windows (7)?

There is no problems then using linux:

install.packages(\'RMySQL\')
library(RMySQL)
...
<         


        
相关标签:
3条回答
  • 2020-12-05 03:51

    You need to install the MySQL headers and libraries, as explained in the installation instructions. Please do read the documentation before turning to SO.

    0 讨论(0)
  • 2020-12-05 04:07

    possible duplicate. However, my suggestions is to try WAMP which comes as a one click install. Admittedly you get more than you need (webserver) but the MySQL installation runs pretty well.

    0 讨论(0)
  • 2020-12-05 04:09

    Found solution with help of ran2, who gave me link to common question. The basic process is described here, but there are several hints, So I will describe the whole solution (please change the R version and paths if needed):

    1. Install latest RTools from here
    2. install MySQL or header and library files of mysql
    3. create or edit file C:\Program Files\R\R-2.12.1\etc\Renviron.site and add line like MYSQL_HOME=C:/mysql (path to your mysql files)
    4. copy libmysql.lib from mysql/lib to mysql/lib/opt to meet dependencies.
    5. copy libmysql.dll to C:\Program Files\R\R-2.12.1\bin or to windows/system32 directory.
    6. run install.packages('RMySQL',type='source') and wait while compilation will end.

    Thanks to all who tried to answer.

    0 讨论(0)
提交回复
热议问题