FreeTDS+unixODBC+SQL Server 2005编译和设置:
参考:
1. unixODBC+FreeTDS+DBD::ODBCでSQL Serverに接続する
http://rebecca.ac/milano/mt/archives/001412.html
2. Connecting to SQL 2005 via ODBC and Python from Ubuntu - for free
http://www.neuronical.com/?p=16
Compiling On the Ubuntu 8.04 LTS:
1) unixodbc
wget http://www.unixodbc.org/unixODBC-2.2.12.tar.gz
cd $startdir/src/unixODBC-$pkgver
sed -i 's/YY_FLUSH_BUFFER/yy_flush_buffer(YY_CURRENT_BUFFER)/' sqp/lex.l
./configure --prefix=/usr --sysconfdir=/etc --enable-gui=no
make
sudo make install
2) libiconv
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.12.tar.gz
wget http://www2d.biglobe.ne.jp/~msyk/software/libiconv/libiconv-1.12-cp932.patch.gz
tar xvzf libiconv-1.12.tar.gz
gunzip libiconv-1.12-cp932.patch.gz
patch -p0 < libiconv-1.12-cp932.patch
cd libiconv-1.12
./configure --prefix=/usr
make
sudo make install
3) freetds
wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr --sysconfdir=/etc/freetds --with-unixodbc=/usr --with-msdblib --with-libiconv-prefix=/usr/lib --with-tdsver=8.0
make
sudo make install
MONO+SqlClient编译出错的解决办法:
1. System.NotSupportedException: CodePage 932 not supported.
For me, installing the following package resolve the issue:
sudo apt-get install libmono-i18n2.0-cil
2. Cannot connect to the server...
Modify the freetds.conf and try the sqsh/tsql execute then it work on.