我正在运行 Gentoo Linux,并尝试通过pyodbc
使用freetds
.
我启用了调试登录freetds
。现在,当我尝试连接时,我看到了以下内容:
18:13:00.841828 13523 (net.c:270):tds_open_socket: connect(2) returned "Operation now in progress"
18:13:00.955976 13523 (net.c:310):tds_open_socket() succeeded
18:13:00.955996 13523 (util.c:156):Changed query state from DEAD to IDLE
18:13:00.956017 13523 (net.c:741):Sending packet
0000 12 01 00 34 00 00 00 00-00 00 15 00 06 01 00 1b |...4.... ........|
0010 00 01 02 00 1c 00 0c 03-00 28 00 04 ff 08 00 01 |........ .(......|
0020 55 00 00 02 4d 53 53 51-4c 53 65 72 76 65 72 00 |U...MSSQ LServer.|
0030 d3 34 00 00 - |.4..|
18:13:01.190745 13523 (net.c:555):Received header
0000 04 01 00 25 00 00 01 00- |...%....|
18:13:01.190772 13523 (net.c:609):Received packet
0000 04 01 00 25 00 00 01 00-00 00 15 00 06 01 00 1b |...%.... ........|
0010 00 01 02 00 1c 00 01 03-00 1d 00 00 ff 0a 32 10 |........ ......2.|
18:13:01.190781 13523 (login.c:1057):detected flag 3
18:13:01.190783 13523 (login.c:1068):server required encryption but support is not compiled in
18:13:01.190785 13523 (login.c:466):login packet rejected
18:13:01.190821 13523 (util.c:156):Changed query state from IDLE to DEAD
听起来好像缺少对某些加密的支持,但我不知道是哪一种。我freetds
遵守这些配置参数:
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --libdir=/usr/lib64 --with-tdsver=7.0 --enable-msdblib --enable-odbc --with-unixodbc=/usr --enable-krb5
据我所知它用于libkrb5
加密。这些是我的配置标志libkrb5
:
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --without-ldap --without-tcl --enable-pkinit --enable-thread-support --without-hesiod --enable-shared --with-system-et --with-system-ss --enable-dns-for-realm --enable-kdc-lookaside-cache --with-system-verto --disable-rpath --with-pkinit-crypto-impl=openssl
有人知道我缺少哪些配置标志才能连接到 MS SQL?
答案1
我自己弄清楚了,在freetds
我缺少的配置参数中--with-openssl
。一旦我添加了它并重新安装,freetds
一切就正常了。