unixODBC FreeTDS 上的错误

unixODBC FreeTDS 上的错误

我正在尝试使用 unixODBC FreeTDS 查询 SQL Server DB 和isql

我收到错误:

[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

当我输入 odbcinst 时我得到:

unixODBC 2.3.1
DRIVERS............: /home/pmattos/etc/odbcinst.ini
SYSTEM DATA SOURCES: /home/pmattos/etc/odbc.ini
FILE DATA SOURCES..: /home/pmattos/etc/ODBCDataSources
USER DATA SOURCES..: /home/pmattos/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

如果我输入cat /home/pmattos/etc/odbc.ini

[dbserverdsn]
        Driver = FreeTDS
        Server = 10.23.11.10
        Port = 1433
        Database=Market
        TDS_Version = 7.2

如果我输入cat /home/pmattos/etc/odbcinst.ini

[FreeTDS]
        Description = v0.91 with protocol v7.2
        Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so

我的 FreeTDS 文件如下所示:

[global]
    # TDS protocol version, use:
    # 7.3 for SQL Server 2008 or greater (tested through 2014)
    # 7.2 for SQL Server 2005
    # 7.1 for SQL Server 2000
    # 7.0 for SQL Server 7
    tds version = 7.2
    port = 1433
    text size = 64512

# A typical Microsoft server
[dbserverdsn]
    host = 10.23.11.10
    port = 1433
    tds version = 7.2

值得一提的是,我能够使用它来查询数据库tsql。但发送命令也tsql -LH serverName不会返回任何内容。

使用:

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04

对我可能遗漏的内容有什么想法吗?

相关内容