我使用的是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")时,没有建立连接。怎么了?

最佳答案

odbcConnect()需要您的用户名(uid)和密码(pwd):

    odbcConnect(dsn, uid, pwd, ...)

关于mysql - 我必须位于哪个工作目录中才能连接到R中的MySQL服务器,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27410579/

10-12 19:44