odbcunix+freetds连接mssql 的dsn连接字串要如何写?

下面的字段在win下连mssql的时候没有问题

[Copy to clipboard] [ - ]
CODE:
my $dsn = "driver={SQL Server};Server=". $srv_name .";database=". $db_name .";";
my $dbh = DBI->connect( "dbi:ODBC:$dsn", $db_user,$db_pwd, { RaiseError => 1, AutoCommit => 0 } );

在linux下,在odbcinst.ini中添加驱动.

[Copy to clipboard] [ - ]
CODE:
[TDS]
Description     = MS-SQLServer
Driver          = /usr/local/lib/libtdsodbc.so
Setup           = /usr/local/lib/libtds.so
FileUsage       = 1

再把连接的$dsn字串驱动改成TDS

[Copy to clipboard] [ - ]
CODE:
my $dsn = "driver={TDS};Server=". $srv_name .";database=". $db_name .";";
my $dbh = DBI->connect( "dbi:ODBC:$dsn", $db_user,$db_pwd, { RaiseError => 1, AutoCommit => 0 } );

提示如下:

[Copy to clipboard] [ - ]
CODE:
DBI connect('Driver={TDS};Server=192.168.1.1;database=testdb;','sa',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at trans.pl line 16

..............