Mac (Mac OS X 10.11.2)의 R에서 MySQL 데이터베이스에 액세스하는 데 문제가 있습니다. 다음 코드 :Mac OS X에서 R의 MySQL 데이터베이스에 액세스
library("RODBC")
mycom <- odbcConnect("wsn_mysql_5", uid="root", pwd="*****")
이 오류를 제공합니다 :
1: In RODBC::odbcDriverConnect("DSN=wsn_mysql_5;UID=root;PWD=****") :
[RODBC] ERROR: state 00000, code 15509574, message
[iODBC][DriverManager]dlopen(/usr/local/lib/libmyodbc5a.so,
6): no suitable image found. Did find:
/usr/local/lib/libmyodbc5a.so: mach-o, but wrong architecture
2: In RODBC::odbcDriverConnect("DSN=wsn_mysql_5;UID=root;PWD=****") :
[RODBC] ERROR: state IM003, code 15509574, message
[iODBC][Driver Manager]Specified driver could not be loaded
내가 지금까지 시도하는 것 :
- 나는이 iODBC 드라이버 관리자 3.52.12를 설치했습니다.
- MySQL 커넥터 odbc-5.3.6-osx10.11-x86-64bit를 설치하고 DSN (server = localhost, user = root, password = *****, database = wsn_db)을 만들었습니다. 이 iODBC 관리자에 테스트 때이 오류가 발생했다
:
[iODBC][Driver manager]dlopen(/usr/local/lib/libmyodbc5w.so, 6): no suitable image found.
Did find: /usr/local/lib/libmyodbc5w.so: mach -o, but wrong architecture.
How to add ODBC to MAMP on OSX
날 즉 생각하는 32 비트 대 64 비트 문제가 있었다했다.- 그래서 최근에 발견 된 32 비트 버전 인 odbc-5.2.7-osx10.7-x86-32bit MySQL 커넥터를 설치했습니다. 나는이 iODBC 관리자와이를 테스트 할 때 작동하는 것 같다,하지만 난이 유형의 오류에 대한 다음과 같은
이 iODBC의 질문 말한다 R.의 코드를하려고 할 때 나는 처음에 언급 한 오류가 발생합니다 :
[iODBC] [Driver Manager]Specified driver could not be loaded
There are a few reasons why this could occur, and thinking through the architecture helps. Your application has loaded libiodbc successfully, and it has found an odbc.ini file (or equivalent through the ODBCINI environment variable), and it has found a DSN within that odbc.ini that matches the name requested in your connection.
However, the driver manager has had problems loading the library specified in the `Driver=' line of that DSN definition. Either it doesn't exist, or its permissions are insufficient to allow your application to load it (it must be readable and executable, and the directories leading down to it must be executable), or maybe the file is not a dynamic library - it could be a static library (a *.a file except on AIX) or is otherwise corrupted. These are all things to check, or you may be best off reinstalling the driver if all the permissions check out.
- 그래서 권한을 확인했지만 정확했습니다.
또한 드라이버를 다시 설치했지만 아무 것도 변경하지 않았습니다.
this을 읽은 후 odbc.ini와 obdcinst.ini를 확인했습니다.
[ODBC Drivers] MySQL ODBC 5.2 ANSI Driver=Installed MySQL ODBC 5.2 Unicode Driver=Installed [ODBC Connection Pooling] PerfMon=0 Retry Wait= [MySQL ODBC 5.2 ANSI Driver] Driver = /usr/local/lib/libmyodbc5a.so Description = mySQL driver Threading = 0 [MySQL ODBC 5.2 Unicode Driver] Driver = /usr/local/lib/libmyodbc5w.so Description = mySQL driver Threading = 0
에
[ODBC Data Sources] wsn_mysql_7 = wsn_mysql_7 [ODBC] TraceLibrary= [wsn_mysql_7] Driver = /usr/local/lib/libmyodbc5w.so DATABASE = wsn_db DESCRIPTION = DSN for wsn_db in R SERVER = localhost UID = root PASSWORD = *****
및 ODBCINST.INI 그러나 아무것도 변경하는 것 같지 않았어요 :
또한 this question을 기반으로하는 다른 RODBC 코드를 사용해 보았습니다.
mycom <- odbcDriverConnect("Provider=MSDASQL;Driver={MySQL ODBC 5.2 UNICODE Driver}; Server=localhost;database=wsn_db;Uid=root;Pwd=*****;Option=3")
나는 다음에 무엇을 확실하지 않다? R에서 mySQL 데이터에 액세스하는 완전히 다른 방법조차도 도움이 될 것입니다.
[RMySQL] (https://cran.r-project.org/package=RMySQL)을 사용해 보셨습니까? – ytk
MAMP를 사용하여 Mac에서 RMySQL을 사용하여 성공했습니다. –
RMySQL은 ODCB 드라이버가 필요합니까? 왜냐하면 이것이 문제의 원인이라고 생각하기 때문입니다. –