iODBC 在 Mac OSX 10.6.4 下不工作

发布于 2024-09-26 22:05:02 字数 854 浏览 2 评论 0原文

我已经通过包(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

眼趣 2024-10-03 22:05:02

看看 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)

信仰 2024-10-03 22:05:02

遵循的步骤:

  1. brew install freetds

  2. subl ~/Library/ODBC/odbc.ini

  3. [sqlserver01]
    驱动程序=/usr/local/lib/libtdsodbc.so
    TDS_Version=7.2
    服务器=192.168.8.7
    端口 = 1433
    跟踪 = 是
    描述=ds01
    # 数据库=
    # 无法指定 freetds 的用户名和密码

  4. subl ~/.freetds.conf

  5. host = ds01.uswa.net # 服务器名称
    端口 = 1433
    tds 版本 = 8.0 # 适用于 2008+

  6. sudo pip 安装 pyodbc
    sudo pip 安装 sqlsoup

Python 连接字符串将如下所示:

# Steve is my username; steve is my password; #sqlserver01 is my DSN in odbc.ini
db = sqlsoup.SQLSoup('mssql+pyodbc://Steve:steve@sqlserver01')

SQLAlchemy 方式将如下所示:

engine = create_engine('mssql+pyodbc://Steve:steve@sqlserver01')`

执行任何查询...

Steps to follow:

  1. brew install freetds

  2. subl ~/Library/ODBC/odbc.ini

  3. [sqlserver01]
    Driver=/usr/local/lib/libtdsodbc.so
    TDS_Version=7.2
    Server=192.168.8.7
    Port = 1433
    Trace = Yes
    Description=ds01
    # Database=
    # can't specify username and password for freetds

  4. subl ~/.freetds.conf

  5. host = ds01.uswa.net # server name
    port = 1433
    tds version = 8.0 # works with 2008+

  6. sudo pip install pyodbc
    sudo pip install sqlsoup

The Python Connection String would look like this:

# Steve is my username; steve is my password; #sqlserver01 is my DSN in odbc.ini
db = sqlsoup.SQLSoup('mssql+pyodbc://Steve:steve@sqlserver01')

The SQLAlchemy way would look like this:

engine = create_engine('mssql+pyodbc://Steve:steve@sqlserver01')`

Do whatever queries…

感性不性感 2024-10-03 22:05:02

我遇到了同样的问题,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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文