【问题标题】:How to install RMysql on Windows 7 with proxy settings [closed]如何使用代理设置在 Windows 7 上安装 RMysql [关闭]
【发布时间】:2011-08-28 03:44:12
【问题描述】:

我正在努力在 Windows 7 64 位的 R2.13.0 上安装 RMysql。我的mysql 5.5、64bit的版本。以下是导致我出错的步骤:

  1. 安装 RTools
  2. 通过调用设置代理:setInternet2(TRUE)FAQ@CRAN 之后
  3. this post on SO之后设置MYSQL_HOME:Sys.setenv("MYSQL_HOME"="C:\\Program Files\\MySQL\\MySQL Server 5.5\\")
  4. 在 R 控制台中调用:install.packages("RMySQL", type="source")

4 后出现如下错误:

Installing package(s) into ‘C:/Users/Foo/Documents/R/win-library/2.13’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://artfiles.org/cran/src/contrib
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘RMySQL’ is not available (for R version 2.13.0)

替代 4 只是安装包:install.packages("RMySQL")。在这种情况下,我得到了:

Installing package(s) into ‘C:/Users/foo/Documents/R/win-library/2.13’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://artfiles.org/cran/bin/windows/contrib/2.13
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘RMySQL’ is not available (for R version 2.13.0)

我确信连接没有问题,因为我可以调用 R update。 谁能帮我找出如何从 R 访问 mysql db?

ps。这是 sessionInfo() 的输出

R version 2.13.0 (2011-04-13)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

更新:我没有代理直接连接到互联网,现在我得到了:

> install.packages("RMySQL", type="source")
Installing package(s) into ‘C:/Users/foo/Documents/R/win-library/2.13’ (as
‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://ftp.yalwa.org/cran/src/contrib/RMySQL_0.7-5.tar.gz'
Content type 'application/x-gzip'
length 160769 bytes (157 Kb) opened
URL downloaded 157 Kb

* installing *source* package 'RMySQL' ... ERROR: configuration failed for
package 'RMySQL'
* removing 'C:/Users/foo/Documents/R/win-library/2.13/RMySQL'

The downloaded packages are in
        ‘C:\Users\foo\AppData\Local\Temp\RtmpaUw1Tj\downloaded_packages’
Warning messages: 1: running command
'C:/PROGRA~1/R/R-213~1.0/bin/i386/R
CMD INSTALL -l
"C:/Users/foo/Documents/R/win-library/2.13"
C:\Users\foo\AppData\Local\Temp\RtmpaUw1Tj/downloaded_packages/RMySQL_0.7-5.tar.gz'
had status 1  2: In
install.packages("RMySQL", type = "source") :
   installation of package 'RMySQL' had non-zero exit status


    loaded via a namespace (and not attached):
    [1] tools_2.13.0

【问题讨论】:

  • 到目前为止,我的解决方案:Win7上的虚拟机 + xubuntu + R + RMySQL + Rstudio。

标签: mysql r windows-7 rmysql


【解决方案1】:

您应该仔细检查您正在使用的存储库。在我看来应该是

install.packages("RMySQL", repos='http://artfiles.org/cran.r-project.org/')

或类似的东西。您可以尝试在浏览器中打开您发布的 URL 进行检查。

【讨论】:

  • 没有。它不能解决问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-11
  • 1970-01-01
  • 1970-01-01
  • 2012-03-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多