[freetds] Problems Connecting Debian --> MSSQL through odbc
jklowden at schemamania.org
jklowden at schemamania.org
Tue Jul 14 16:43:48 EDT 2009
On Tue, Jul 14, 2009 at 09:50:48PM +0200, Jaap van Arragon wrote:
> I've runned the script and here is the output:
>
> SERVER:~# ./osqlscript.sh -S TEST -U admin -P pass
> checking shared odbc libraries linked to isql for default directories...
> strings: '': No such file
What is the output of "ldd $(command -v isql)"?
I would be interested to see the output of
$ sh -x ./osqlscript.sh -S TEST -U admin -P pass
> osqlscript.sh: problem: no potential directory strings in "/usr/bin/isql"
> osqlscript.sh: advice: use "osql -I DIR" where DIR unixODBC\'s install
> prefix e.g. /usr/local
> isql strings are:
> + /lib/ld-linux.so.2
The above interrogation -- which tries to discover where unixODBC is installed -- failed. osql could stop here, but proceeds with examining the per-user files.
> checking odbc.ini files
> reading "/root/.odbc.ini"
> [TEST] found in "/root/.odbc.ini"
You're apparently running as root, so, yes, it finds root's per-user file.
> found this section:
> [TEST]
> Driver = FreeTDS
> Description = A good description of your DB
> Trace = Yes
> Server = [10.10.10.51]
> Port = 1433
> TDS_Version = 7.0
>
> looking for driver for DSN [TEST]
> driver line incomplete for [TEST] in .odbc.ini
Apparently the grep/sed/awk combination failed to parse
Driver = FreeTDS
What does this print:
$ echo Driver = FreeTDS \
| awk -F '[[:space:]]*=[[:space:]]*' '{print $2}'
Maybe your awk doesn't recognize "[[:space:]]" as a regular expression? (I doubt that's the case; it works on RHEL.) Anyway, the "sh -x" command above should shed some light on these questions.
Meanwhile, you're helping me debug the debugger, and getting no closer to your own solution. So let me explain what you need to look for while you're helping me.
The Driver line in your odbc.ini can refer to one of two things:
1. A shared object e.g. /lib/libtdsodbc.so, or
2. An entry in odbcinst.ini
The latter gives you one move level of indirection. If you want to use it, you should have an odbcinst.ini that looks like this:
[FreeTDS]
Description = FreeTDS ODBC driver version 0.82
Driver = /path/to/your/libtdsodbc.so
Where is your odbcinst.ini, and what does it say? And where is libtdsodbc.so?
HTH.
--jkl
More information about the FreeTDS
mailing list