libtdsodbc.so.0 missing?

Asked by adisharoon

I seem to recall libtdsodbc.so.0 was once part of this package... I need it to connect to a MSSQL database with python. There is an old bug mentioning that it was missing in an earlier version, too. As it is, there is no sign of this driver anywhere after installing freetds-dev.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu freetds Edit question
Assignee:
No assignee Edit question
Solved by:
mycae
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

can you give the output of:

cd /usr/lib; ls libtdsodbc*

Thanks

Revision history for this message
adisharoon (alecdisharoon) said :
#2

ls: cannot access libtdsodbc*: No such file or directory

I'm on 10.10 desktop 64 bit. I'm pretty sure I've had it working on a previous version of Ubuntu, and that that was a 64 bit version as well.

Revision history for this message
Best mycae (mycae) said :
#3

thats a bit weird... This might be a bug,

apt-file only shows the .so available in my index, rather than the .so.0 as welll. The .so file should be a symlink to the actual library... The .so is stored in /usr/lib/odbc/ ...

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

You will need to compile it:

sudo -i
cd /usr/local/src
wget <a href="http://www.unixodbc.org/unixODBC-2.2.11.tar.gz">http://www.unixodbc.org/unixODBC-2.2.11.tar.gz</a>
gunzip unixODBC*.tar.gz
tar xvf unixODBC*.tar
cd unixODBC*
./configure
make
make install

Should do it

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5
Revision history for this message
mycae (mycae) said :
#6

Yes, I believe it is a bug, and have emailed the debian maintainer.

Revision history for this message
mycae (mycae) said :
#7

I do not think a recompilation is needed. You should simply be able to move the generated .so files in /usr/lib/odbc to their soversioned names (libtdsodbc.so.0 and friends). Then, just to be safe, you should create symlinks from the unversioned names (libtdsodbc.so and friends) to their versioned ones.

To do this try running this as root (you can "sudo su" here, its not technically the right way to do it but it will be fine)

--------------- cut below line ----------
for i in /usr/lib/odbc/*so ;do mv $i $i.0; ln -s $i.0 $i ; done

------------- cut above line ----------

Revision history for this message
adisharoon (alecdisharoon) said :
#8

Thanks mycae, that solved my question.

Revision history for this message
adisharoon (alecdisharoon) said :
#9

I got:

[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source

when using:

Driver = /usr/lib/odbc/libtdsodbc.so.0

in my /etc/odbc.ini

and I was apparently missing a required library when trying to compile... but I think this is enough to get me started. Thanks, guys.

Alec

Revision history for this message
Steve Langasek (vorlon) said :
#10

No, you should *not* rename files in /usr/lib/odbc - these files are owned by packages, renaming them will cause your local changes to be overlooked on package upgrade.

You should instead fix your odbcinst.ini to not point at "/usr/lib/odbc/libtdsodbc.so.0", which is not, and never has been, the correct path. It should point at "/usr/lib/odbc/libtdsodbc.so", the file that is being installed.

Revision history for this message
adisharoon (alecdisharoon) said :
#11

OK Steve. There are a lot of people on forums out there, and other informal documentation, saying to use libtdsodbc.so.0, and since, previously, I think, it was included in this package. I didn't see the harm in using it. Of course, I don't know anything about how this stuff work, I just needed my python to talk to my mssql. So I'm sure you're right.