iODBC 在 Mac OSX 10.6.4 下不工作
我已经通过包(http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/)安装了 iODBC 并按照此处所述设置了所有配置文件: http://blog.opensteam.net/past/2009/1/28/rails_ms_sql_on_mac/
我设置了同样的东西在 Linux 机器上并且运行良好。在我的 Mac OSX 10.6.4 上,如果我测试连接,我会收到此错误:
xxx@xxx:/opt/local/include$ iodbctest "dsn=res;uid=user;pwd=pass"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0709.0909
1: SQLDriverConnect = [iODBC][Driver Manager]dlopen(/opt/local/lib/libtdsodbc.so, 6): Symbol not found: _CreateDataSource
Referenced from: /usr/lib/libiodbcinst.2.dylib
Expected in: flat namespace
(0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
我不知道如何调试此:(
I've installed iODBC over the package (http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/) and set up all config files as described here: http://blog.opensteam.net/past/2009/1/28/rails_ms_sql_on_mac/
I set up the same thing on a Linux machine and it worked fine. On my Mac OSX 10.6.4, I get this error if i test the connection:
xxx@xxx:/opt/local/include$ iodbctest "dsn=res;uid=user;pwd=pass"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0709.0909
1: SQLDriverConnect = [iODBC][Driver Manager]dlopen(/opt/local/lib/libtdsodbc.so, 6): Symbol not found: _CreateDataSource
Referenced from: /usr/lib/libiodbcinst.2.dylib
Expected in: flat namespace
(0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
I have no idea how to debug this :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看 odbc.ini 和 odbcinst.ini 文件中所使用的 DSN 和 FreeTDS 驱动程序有哪些参数会很有趣?
看起来 Apple iODBC 驱动程序管理器无法加载驱动程序所需的设置例程,FreeTDS 驱动程序本身也无法加载。
适用于 Mac OS X 的 OpenLink iODBC 驱动程序管理器(Apple 捆绑的驱动程序管理器就是基于该管理器)是基于框架的,并且包含用于为那些没有内置的 ODBC 驱动程序加载通用设置和登录对话框的例程。您可以从以下位置免费下载它(因为它是开源的):
http://www.iodbc.org/downloads/iODBC/iodbc-sdk-3.52.7-macosx-10.5.dmg(适用于 10.5 和 10.6)
It would be interesting to see what params you have in your odbc.ini and odbcinst.ini files for the DSN and FreeTDS driver being used ?
Looks as if the Apple iODBC Driver Manager is not able to load setup routines required for the driver nor does the FreeTDS driver itself.
The OpenLink iODBC Driver Manager for Mac OS X (which Apples bundled one is based on) is Framework based and does include routines for loading generic setup and login dialogs for those ODBC drivers that do not have built in one. You can download it free (as it is open source) from the following location:
http://www.iodbc.org/downloads/iODBC/iodbc-sdk-3.52.7-macosx-10.5.dmg (it is for 10.5 and 10.6)
遵循的步骤:
brew install freetds
subl ~/Library/ODBC/odbc.ini
subl ~/.freetds.conf
Python 连接字符串将如下所示:
SQLAlchemy 方式将如下所示:
执行任何查询...
Steps to follow:
brew install freetds
subl ~/Library/ODBC/odbc.ini
subl ~/.freetds.conf
The Python Connection String would look like this:
The SQLAlchemy way would look like this:
Do whatever queries…
我遇到了同样的问题,linux 可以工作,Lion 10.7 不行(我猜 10.6 也有同样的问题)。
我正在使用 FreeTDS 驱动程序进行连接,从源代码进行编译:看起来编译时,libtdsodbc.so 编译为错误的体系结构或 32 位/64 位。
我遵循了这个指南(不包括 Excel 部分),一切都很顺利。
http://asmiler.blogspot.fr/2011/10 /accessing-mssql-databases-from-excel.html
I had the same problem, linux works, Lion 10.7 not (I guess same problem for 10.6).
I'm using FreeTDS driver to connect, compiling from the source code: it looks like that when compiling, libtdsodbc.so is compiled for the wrong architecture or 32bit/64bit.
I followed this guide (excluding Excel part), and everything worked like a charm.
http://asmiler.blogspot.fr/2011/10/accessing-mssql-databases-from-excel.html