在Windows中安装RMySQL



我按照博客文章在Windows下安装RMySQL中的说明进行操作。 软件包似乎已安装,但实际上失败了。

安装输出:

* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:/Program Files (x86)/MySQL/mysql-5.6.21-winx64/mysql-5.6.21-winx64
cygwin warning:
  MS-DOS style path detected: C:/Program
  Preferred POSIX equivalent is: /cygdrive/c/Program
  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
test: Files: unknown operand
** libs
Aviso: this package has a non-empty 'configure.win' file,
so building only the main architecture
cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-31~1.1/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-31~1.1/include" -DNDEBUG -I"C:/Program Files (x86)/MySQL/mysql-5.6.21-winx64/mysql-5.6.21-winx64"/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-31~1.1/include" -DNDEBUG -I"C:/Program Files (x86)/MySQL/mysql-5.6.21-winx64/mysql-5.6.21-winx64"/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:/Program Files (x86)/MySQL/mysql-5.6.21-winx64/mysql-5.6.21-winx64/bin/libmySQL.dll -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.1/bin/x64 -lR
gcc.exe: error: C:/Program Files (x86)/MySQL/mysql-5.6.21-winx64/mysql-5.6.21-winx64/bin/libmySQL.dll: No such file or directory
no DLL was created
ERROR: compilation failed for package 'RMySQL'
* removing 'C:/Users/EdmondGA/Documents/R/win-library/3.1/RMySQL'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:UsersEdmondGADocumentsRwin-library3.1" C:UsersEdmondGAAppDataLocalTempRtmpc9ayHH/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:UsersEdmondGAAppDataLocalTempRtmpc9ayHHdownloaded_packages’

但是当我尝试使用该库时,出现以下错误:

library(RMySQL)
Error in library(RMySQL) : there is no package called ‘RMySQL’

如何正确安装 RMySQL?

我会使用RStudio,它有一个Windows安装程序。 从那里你可以运行:

install.packages('RMySQL')

我不确定RStudio是什么,但它似乎与RMySQL软件包很好地集成在一起

最新更新