我正在爲Windows 7 64bit R2.13.0上的RMysql安裝而戰。我的MySQL 5.5,64位版本。下面是步驟,這使我的錯誤:如何使用代理設置在Windows 7上安裝RMysql
- 安裝RTools
- 通過調用設置代理:
setInternet2(TRUE)
後[email protected] - 集MYSQL_HOME:
Sys.setenv("MYSQL_HOME"="C:\\Program Files\\MySQL\\MySQL Server 5.5\\")
後this post on SO - 調用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更新。 任何人都可以幫助我瞭解如何從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上的虛擬機。 – Skarab 2011-05-19 20:36:34