adding RMySQL package to R fails (on Windows)?

后端 未结 11 2310
予麋鹿
予麋鹿 2020-11-30 06:03

I can\'t figure out why my RMySQL package won\'t install - here\'s what I get:

> install.packages(\'RMySQL\',type=\'source\')
trying URL \'http://cran.mir         


        
相关标签:
11条回答
  • 2020-11-30 06:51

    As Marek said. There is no windows binary for this package. I had similar troubles on my Mac when I tried to install RPostgreSQL (because there's no binary for Mac) in the end I had to compile it on my own and modify several files.

    For the MySQL part(if you don't know much about MySQL), you might want to use WAMP which is admittedly more than you need, but easy to install and to start and shut down.

    For some compiling help you might be interested in Rtools

    HTH

    BTW: What kind of windows do you run (sry, if I missed it)

    0 讨论(0)
  • 2020-11-30 06:53

    Following worked for me in red hat linux

    wget http://cran.r-project.org/src/contrib/RMySQL_0.9-3.tar.gz
    sudo R CMD INSTALL  --configure-args='--with-mysql-inc=/usr/include/mysql' --configure-args='--with-mysql-lib=/usr/lib64/mysql' RMySQL_0.9-3.tar.gz
    
    0 讨论(0)
  • 2020-11-30 06:54

    I was having this same problem on Windows 7 with R 2.12.1 x64 and resolved it by:

    1. Changing the R directory in my PATH variable to C:\Program Files\R\R-2.12.1\bin\x64 (rather than just ...\R-2.12.1\bin).
    2. Copying ...\MySQL Server 5.5\lib\libmysql.dll to ...\MySQL Server 5.5\bin\.
    3. Running R CMD INSTALL RMySQL_0.7-5.tar.gz in cmd.exe (install.packages('RMySQL',type='source') in R still would not work).
    0 讨论(0)
  • 2020-11-30 06:54

    You however there is one additional requirement at present (with the MySQL server version 5.5 & R2.12.1) follow thehttp://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL instructions at present as the locations of the libmySQL.dll differs to what is expected in the package.

    i.e. for the 64bit compiling. it expects the libmySQL.dll to be in "${MYSQL_HOME}"/bin/libmySQL.dll so simply copy the dll over to the /bin dir and it will now compile.

    for the 32bit compilling. the libmySQL.lib is expected in "${MYSQL_HOME}"/lib/opt/libmysql.lib again moving this should solve the problem.

    Alternatively, if you don't want to or can't move these files. Then you can edit the source code files: Makevars.win Makevars.win32 Makevars.win64 appropriately pointing to /lib/libmysql.dll /lib/libmysql.lib

    0 讨论(0)
  • 2020-11-30 06:56

    I came across this step-by-step guide to install RMySQL under Windows7 64bit.

    http://www.ahschulz.de/2013/07/23/installing-rmysql-under-windows/

    The software I used are:

    1. Windows 8 OS
    2. R3.0.2 - 64bit
    3. Rtools 3.1
    4. MySQL Server Community Edition 5.6 - 64bit

    Following the above guide (with screenshots provided), my installation and loading of the RMySQL package works.

    Many thanks to Arne Hendrik Schulz!

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