Question

I used this guide: Using MySQL in R for Windows but it didn't help. I'm already searching for hours on this problem. Since I can't figure out my problem I just can send here the log when trying to install.packages('RMySQL',type='source')

> Warning in install.packages :   package ‘RMySQL’ is not available (for
> R version 3.0.2) Installing package into ‘C:/Users/Mr.
> Kox/Documents/R/win-library/3.0’ (as ‘lib’ is unspecified) trying URL
> 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz' Content type
> 'application/x-gzip' length 165363 bytes (161 Kb) opened URL
> downloaded 161 Kb
> 
> * installing *source* package 'RMySQL' ...
> ** Paket 'RMySQL' erfolgreich entpackt und MD5 Summen überprüft
>       0 [main] sh 6324 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to the public mailing
> list cygwin@cygwin.com checking for $MYSQL_HOME... C:/xampp/mysql
> cygwin warning:   MS-DOS style path detected: C:/xampp/mysql  
> Preferred POSIX equivalent is: /cygdrive/c/xampp/mysql   CYGWIN
> environment variable option "nodosfilewarning" turns off this warning.
> Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> ** libs Warnung: this package has a non-empty 'configure.win' file, so building only the main architecture
> 
>       0 [main] make 6988 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer.  Please report this problem to the public mailing
> list cygwin@cygwin.com cygwin warning:   MS-DOS style path detected:
> C:/PROGRA~1/R/R-30~1.2/etc/x64/Makeconf   Preferred POSIX equivalent
> is: /cygdrive/c/PROGRA~1/R/R-30~1.2/etc/x64/Makeconf   CYGWIN
> environment variable option "nodosfilewarning" turns off this warning.
> Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames gcc -m64 -I"C:/PROGRA~1/R/R-30~1.2/include" -DNDEBUG -I"C:/xampp/mysql"/include    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o RS-DBI.c: In function 'RS_na_set': RS-DBI.c:1219:11: warning: variable 'c' set but not used
> [-Wunused-but-set-variable] gcc -m64
> -I"C:/PROGRA~1/R/R-30~1.2/include" -DNDEBUG -I"C:/xampp/mysql"/include    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o RS-MySQL.c: In function 'RS_MySQL_fetch': RS-MySQL.c:657:13: warning: variable
> 'fld_nullOk' set but not used [-Wunused-but-set-variable] RS-MySQL.c:
> In function 'RS_DBI_invokeBeginGroup': RS-MySQL.c:1137:30: warning:
> variable 'val' set but not used [-Wunused-but-set-variable]
> RS-MySQL.c: In function 'RS_DBI_invokeNewRecord': RS-MySQL.c:1158:20:
> warning: variable 'val' set but not used [-Wunused-but-set-variable]
> RS-MySQL.c: In function 'RS_MySQL_dbApply': RS-MySQL.c:1219:38:
> warning: variable 'fld_nullOk' set but not used
> [-Wunused-but-set-variable] gcc -m64 -shared -s -static-libgcc -o
> RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/xampp/mysql/bin/libmySQL.dll
> -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-30~1.2/bin/x64 -lR collect2: ld returned 5 exit status ERROR: compilation failed for package 'RMySQL'
> * removing 'C:/Users/Mr. Kox/Documents/R/win-library/3.0/RMySQL'
> * restoring previous 'C:/Users/Mr. Kox/Documents/R/win-library/3.0/RMySQL' Warning in install.packages : 
> running command '"C:/PROGRA~1/R/R-30~1.2/bin/x64/R" CMD INSTALL -l
> "C:\Users\Mr. Kox\Documents\R\win-library\3.0"
> C:\Users\MRFFAF~1.KOX\AppData\Local\Temp\RtmpCGe2RS/downloaded_packages/RMySQL_0.9-3.tar.gz'
> had status 1 Warning in install.packages :   installation of package
> ‘RMySQL’ had non-zero exit status
> 
> The downloaded source packages are in     ‘C:\Users\Mr.
> Kox\AppData\Local\Temp\RtmpCGe2RS\downloaded_packages’

I think the main problem is in "collect2: ld returned 5 exit status". Well maybe you guys can help me out. Overall I just want to connect R-Studio with a MySQL database. Thanks.

Was it helpful?

Solution

Found the solution. It's pretty easy.

Go to R-Studio -> Tools -> Options -> R-Version -> and here instead of the current choose "[Default] [32-bit] C:\Program Files\R\R-3.0.2"

Now it works for the issue above. Have fun.

OTHER TIPS

Use RODBC and this guide: http://www.joyofdata.de/blog/make-r-talk-to-mysql-on-windows/

You are using R 64bit apparently - it is important to then use the 64bit connector.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top