如何在 Linux Ubuntu 上配置 freetds 和 unixodbc
How configure freetds and unixodbc on Linux Ubuntu
我正在尝试使用 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.2
odbc.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
但是当我 运行 a isql:
$ isql -v wsus username Password [IM002][unixODBC][Driver Manager]Data
source name not found, and no default driver specified [ISQL]ERROR:
Could not SQLConnect
提前致谢。
在odbcinst.ini中,您需要提供驱动程序名称,而不是DSN。变化:
[wsus]
至:
[FreeTDS]
您还应该修改 TDS 版本,最有可能是 7.3 (SQL Server 2008 - 2014),如上所述。
应该可以做到这一点!祝你好运。
我正在尝试使用 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.2
odbc.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
但是当我 运行 a isql:
$ isql -v wsus username Password [IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified [ISQL]ERROR: Could not SQLConnect
提前致谢。
在odbcinst.ini中,您需要提供驱动程序名称,而不是DSN。变化:
[wsus]
至:
[FreeTDS]
您还应该修改 TDS 版本,最有可能是 7.3 (SQL Server 2008 - 2014),如上所述。
应该可以做到这一点!祝你好运。