FreeTDS - tsql连接,isql失败

时间:2011-11-04 14:02:51

标签: sql-server ruby linux freetds isql

我正在尝试连接到主机上的数据库(windows xp,sql server 05)。我的客户机是Ubuntu 10.04。我可以使用tsql连接和执行命令,但是isql失败。以下是我的配置文件和错误消息。

freetds.conf

text size = 64512

[SQLEXPRESS]
host = 192.168.163.1
port = 1433
tds version = 7.0

ODBCINST.INI

[FreeTDS]
Description     = TDS driver (Sybase/MS SQL)
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
CPTimeout       =
CPReuse         =
FileUsage       = 1

ODBC.INI

[SQLEXPRESS]
Driver          = FreeTDS
Description     = ODBC connection via FreeTDS
Trace           = No
Servername  = 192.168.163.1
Database        = SCOPE_Peel
Port        = 1433
UID         = sa
PWD         = test1234
ReadOnly    = No

TSQL:

tsql -S SQLEXPRESS  -U sa
#success

ISQL:

isql SQLEXPRESS sa test1234 -v
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[ISQL]ERROR: Could not SQLConnect

1 个答案:

答案 0 :(得分:5)

问题在于odbc.ini中的这一行

Servername = 192.168.163.1

它应该是SQLEXPRESS,我认为它指向freetds.conf中配置的服务器的名称