我正在使用Windows 7 64位计算机,尝试直接使用R连接到ODBC驱动程序。我尝试下载RMySQL
包作为源代码,但由于某种原因它无法安装并且只留下这样的错误消息:
* 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/jizzard/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:\Users\jizzard\Documents\R\win-library\3.1" C:\Users\jizzard\AppData\Local\Temp\Rtmp8qnScH/downloaded_packages/RMySQL_0.9-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status
所以我尝试使用RODBC
包。我将我的数据库作为ODBC驱动程序快捷方式(Verizon DMP)
但是当我尝试在R中键入con = odbcConnect("Verizon Fios")
时,没有建立任何连接。出了什么问题?
答案 0 :(得分:1)
odbcConnect()
需要您的用户名(uid
)和密码(pwd
):
odbcConnect(dsn, uid, pwd, ...)