我已经尝试为三个版本的R安装RMySQL,但是我遇到了同样的警告消息,即RMySQL不适用于该版本。 拜托,帮帮我吧。 感谢。
install.packages( “RMySQL”,类型= “源”) install.packages中的警告(“RMySQL”,type =“source”): 'lib =“C:/ Program Files / R / R-2.15.3 / library”'不可写 ---请选择一个CRAN镜子用于本次会议--- 还要安装依赖项'DBI'
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/DBI_0.2-7.tar.gz'
Content type 'application/x-gzip' length 194699 bytes (190 Kb)
opened URL
downloaded 190 Kb
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
<some text missing>
* DONE (DBI)
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:\Program Files (x86)\MySQL\MySQL Server 5.6
ERROR: compilation failed for package 'RMySQL'
* removing 'C:/Users/Chanchal/Documents/R/win-library/2.15/RMySQL'
1: running command 'C:/PROGRA~1/R/R-215~1.3/bin/i386/R CMD INSTALL -l "C:\Users\Chanchal\Documents/R/win-library/2.15" C:\Users\Chanchal\AppData\Local\Temp\RtmpErKHEX/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1
2: In install.packages("RMySQL", type = "source") :
installation of package ‘RMySQL’ had non-zero exit status
> install.packages("RMySQL")
Installing package(s) into ‘C:/Users/Chanchal/Documents/R/win-library/2.15’
(as ‘lib’ is unspecified)
package ‘RMySQL’ is available as a source package but not as a binary
Warning message:
package ‘RMySQL’ is not available (for R version 2.15.3)
答案 0 :(得分:2)
我曾尝试在Windows平台上为R版3.1.0安装RMySQL。它也没用。我遇到了和你一样的问题。在阅读了RMySQL包的文档并搜索了之后,我意识到在Windows上安装RMySQL非常困难,因为它没有像输出中所述的Windows二进制文件。
我没有使用RMySQL,而是按照以下说明安装了RODBC软件包:http://passionfordata.blogspot.com/2012/04/how-to-integrate-r-with-mysql-database.html
RODBC还允许您将R连接到MySQL数据库,减少麻烦并且更容易设置。如果您的目的是连接到MySQL并打开使用不限于RMySQL的包,我会推荐RODBC。