[freetds] MSSQL 2005 +unixODBC +Freetds
Daniel Fazekas
fdsubs at t-online.hu
Mon Apr 23 12:12:48 EDT 2007
On Apr 23, 2007, at 17:25, elmalhi abdelghani wrote:
> [root at Vigor238 etc]# tsql -S 192.168.100.206 -p 1433 -U sa -P radius
> src/tds/login.c: tds_connect: 192.168.100.206:1433:
> Verbindungsaufbau abgelehnt
> Msg 20009, Level 9, State 0, Server OpenClient, Line 0
> Server is unavailable or does not exist.
> There was a problem connecting to the server.
The translation widget says that German text means "Connection
establishment rejected."
I think you'll find that even with telnet, you won't be able to
connect to that IP address and port:
telnet 192.168.100.206 1433
So either that information is wrong, there's a firewall in the middle
not allowing your connection to go through, or some network
configuration problems prevent the two machines from talking to each
other...
**
You have a lot of useless and misleading settings all over the place,
but none of that has anything to do with this problem right now.
> [root at Vigor238 etc]# tsql -S 192.168.100.206 -p 1433 -U sa -P radius
The "-p" option is ignored if you use the -S switch, which expects a
freetds.conf entry, and takes the rest of the settings from there.
> odbc.ini:
> [ENTWICKLUNG1]
> Driver = /usr/local/lib/libtdsodbc.so
> Description = Radius on ENTWICKLUNG1
> Trace = No
> Server = 192.168.100.206
> Port =1433
> Database = radius
This way you are going to have an "ODBC-only configuration," ignoring
the freetds.conf entry, and going with the default TDS version.
http://www.freetds.org/userguide/odbcinionly.htm
I'd recommend the "ODBC-combined configuration" myself, so you could
have one global place for settings in freetds.conf:
http://www.freetds.org/userguide/odbcombo.htm
That would mean changing "Server = 192.168.100.206" above to
"Servername = ENTWICKLUNG1" and removing the Port line entirely.
> odbcinst.ini:
None of this file will be used, since you already specified the full
pathname of the freetds driver in odbc.ini.
> freetds.conf:
> [192.168.100.206]
> host = 192.168.100.206
> port = 1433
> tds version = 7.0
> [ENTWICKLUNG1]
> host = 192.168.100.206
> port = 1433
> tds version = 7.0
Here I'd recommend removing the [192.168.100.206] section entirely,
it could be rather confusing to have a FreeTDS entry name - which
could be any arbitrary string of your choosing - look like an IP
address.
Also bump the tds version to 8.0, since you said you were using SQL
Server 2005.
Then you could do your tsql testing simply with:
tsql -S ENTWICKLUNG1 -U sa -P radius
> Version: freetds v0.63
It might also be a good idea to use a more recent version of freetds
as well, if you are just at the process of setting it all up anyway.
> [root at Vigor238 etc]# isql ENTWECKLUNG1 sa radius
> [ISQL]ERROR: Could not SQLConnect
Note that you called it ENTWICKLUNG1, not ENTWECKLUNG1.
But again, none of the above after the "**" break really matters
right now, if your machine cannot even connect to the given IP
address and port number.
--
fds
More information about the FreeTDS
mailing list