Есть сервер. Хочется сделать такую связку. Для себя, а то с наскоку попробовал и был удивлен. Все не так просто как хотелось бы.
На сервере поставил
freetds-0.91-2.el6.i686
freetds-devel-0.91-2.el6.i686
unixODBC-2.2.14-11.el6.i686
unixODBC-devel-2.2.14-11.el6.i686
perl-DBD-ODBC-1.23-1.el6.rf.i686Показываю конфиги
cat /etc/freetds.conf
# $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".
# Global settings are overridden by those in a database
# server specific section
[global]
# TDS protocol version
tds version = 8.0
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
# A typical Sybase server
#egServer50]
# host = symachine.domain.com
# port = 5000
# tds version = 5.0
#
# A typical Microsoft server
[mssql]
server = 192.168.2.100
port = 1433
tds version = 8.0
[console]cat /etc/odbc.ini[/console]
[Intranet]
Driver = Intranet
Port = 1433
Description = ODBC connection via FreeTDS
Servername = Intranet
ServerNode = 192.168.2.100
Database = test-base
[console] cat /etc/odbcinst.ini[/console]
[ODBC]
Trace = Yes
TraceFile = /tmp/sql.log
ForceTrace = Yes
Pooling = No
[Intranet]
Description = FreeTDS
Driver = /usr/lib/libtdsodbc.so.0
FileUsage = 1
CPTimeout = 5
CPReuse = 5
UsageCount = 1
[console]/usr/bin/tsql -S 192.168.2.100 -U sa Password:
locale is "ru_RU.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20009 (severity 9):
Unable to connect: Adaptive Server is unavailable or does not exist
OS error 111, "В соединении отказано"
There was a problem connecting to the server[/console]
[console] isql -v Intranet sa
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[01000][unixODBC][FreeTDS][SQL Server]Unknown host machine name.
[ISQL]ERROR: Could not SQLConnect
[/console]
Собираем информацию
tsql -LH 192.168.2.100
ServerName SERVER
InstanceName SQLEXPRESS
IsClustered No
Version 10.50.1600.1
tcp 1700
tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc
MS db-lib source compatibility: yes
Sybase binary compatibility: yes
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
SSPI "trusted" logins: no
Kerberos: yes