我试图在Linux上用freetds + unixodbc与Windows上的数据库建立连接,我配置了/etc/freetds/freetds.conf、/etc/odbc.ini和/etc/odbcinst.ini:
freetds.conf:
A typical Microsoft server
[wsus]
host = my-ip-sql-server
port = 1433
tds version = 4.2odbc.ini
[wsus]
Driver = FreeTDS
Trace = No
ServerName = wsus
Database= Asegurador作为
odbcinst.ini
[wsus]
Description = tdsodbc
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
FileUsage = 1
CPTimeout = 5命令输出= tsql -C:
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds
MS db-lib source compatibility: no
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes当我运行一个tsql时,连接是成功的:
$ tsql -S wsus -U username -P password
locale is "es_ES.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1> select top 1 FechaFactura, Vendedor, ClaseDoc from [Aseguradoras].[dbo].[mknDetalleAseguradoras]
2> go
FechaFactura Vendedor ClaseDoc
2014-07-12 xx 2但当我运行isql时:
$ isql -v wsus用户名密码IM002Driver ManagerData源名未找到,也没有默认驱动程序指定ISQLERROR:无法SQLConnect
提前谢谢。
发布于 2015-05-25 15:16:55
在odbcinst.ini中,您需要提供驱动程序名称,而不是DSN。更改:
[wsus]至:
[FreeTDS]您还应该修改TDS版本,最有可能修改为7.3 ( Server 2008-2014年),如前所述。
那就该这么做了!祝好运。
https://stackoverflow.com/questions/30127894
复制相似问题