在R中安装MySQL包

时间:2014-08-01 11:59:24

标签: r

我曾尝试在R中安装MySQL软件包但无法正确安装软件包。这是我用过的代码

install.packages('RMySQL',type='source')

我收到错误

Installing package into ‘C:/Users/Techrains/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
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

* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'RMySQL'
* removing 'C:/Users/Techrains/Documents/R/win-library/3.1/RMySQL'

The downloaded source packages are in
        ‘C:\Users\Techrains\AppData\Local\Temp\Rtmp8ihccf\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.1/bin/i386/R" CMD INSTALL -l "C:\Users\Techrains\Documents\R\win-library\3.1" C:\Users\TECHRA~1\AppData\Local\Temp\Rtmp8ihccf/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

我是R的新手。任何人都可以帮助我,我将不胜感激。 提前谢谢。

1 个答案:

答案 0 :(得分:0)

这似乎是一个愚蠢的问题,但你是否只是尝试:

install.packages("RMySQL")

我刚刚使用上面的代码安装了软件包,并尝试从CRAN库中提取软件包:

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/RMySQL_0.10.4.zip'

这与您的代码尝试的网址不同。另外,这个软件包从CRAN库中只有1.8MB,你的软件只有161KB,这让我相信你的代码正在下载的文件已经关闭。

也许首先尝试使用以下方法删除您下载的软件包:

remove.packages("RMySQL")

编辑:我刚刚意识到这是在一年前被问到的,哎呀。无论如何,我会在这里留下我的答案。