在Ubuntu 11.04 x64上编译FreeTDS 0.91

我正在使用一个Python项目,它使用SQLAlchemy / pyodbc / unixODBC / FreeTDS的无DSN连接从SQL Server数据库中获取数据。 现在我想直接在连接string中设置client charset ,这在0.91之前的FreeTDS版本中是不可能的。

不幸的是,0.91在任何PPA或deb文件中都是不可用的,而且由于我的编译技巧相当缺乏,我还没有能够直接从源代码中直接编译它。

Ubuntu论坛上的用户似乎也有同样的问题 。

那么,我将如何去编译Ubuntu 11.04 x64上的FreeTDS 0.91 ? 任何帮助将不胜感激。

我用了 :

  ./configure --prefix=/usr --sysconfdir=/etc --with-unixodbc=/usr 

安装freetds 0.9.1安装在Ubuntu 11.04上。 在/etc/odbcinst.ini中

  [FreeTDS] Description = TDS driver (Sybase/MS SQL) Driver = /usr/lib/odbc/libtdsodbc.so Setup = /usr/lib/odbc/libtdsS.so 

工作得很好!

从我在Debian Squeeze x64上的笔记,在你的Ubuntu上可能会有点不同,我想我只是按照文档中的说明 。 还没有testing,如果这个具体的变种与例如odbc工作,但它编译和安装好。

 # as root: # tried gnutls for ssl/tls support. aptitude install build-essential automake libgnutls-dev cd /root #Stable release: wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz #wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/current/freetds-current.tgz tar xvzf freetds-stable.tgz # of course adjust depending on directory created: cd freetds-0.91/ # see documentation # for what you can configure # using tdsver 7.2 for fairly recent sql server dbs. # make sure unixodbc is already installed in advance # aptitude install unixodbc # couldn't get openssl or gnutls ssl support working on a fairly clean system # haven't looked into it further ./configure --disable-server --disable-pool --enable-krb5 --enable-sspi --enable-msdblib --with-tdsver=7.2 make; make install; make clean # stuff gets installed in /usr/local/lib and other locations