Hrv*_*e T 12 linux sql-server unixodbc freetds
我试图从Ubuntu连接到MSSQL服务器.我安装了像这里建议的freetds .
但是,当我尝试配置/etc/odbc.ini并输入驱动程序路径时,我在位置没有驱动程序/usr/local/freetds/lib/libtdsodbc.so.
有人可以帮我安装freetds并配置odbc来使用它吗?*edit1:我在/ usr/lib/x86_64-linux-gnu/odbc中找到了libtdsodbc.so.我应该使用该驱动程序/路径吗?
Fli*_*rPA 15
我已经创建了一个Vagrant盒子,其中有一个完整的安装示例:https://github.com/FlipperPA/django-python3-vagrant/
......但这是基本步骤.
# Install pre-requesite packages
sudo apt-get install unixodbc unixodbc-dev freetds-dev freetds-bin tdsodbc
Run Code Online (Sandbox Code Playgroud)
将odbcinst.ini指向/etc/odbcinst.ini中的驱动程序:
[FreeTDS]
Description = v0.91 with protocol v7.2
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Run Code Online (Sandbox Code Playgroud)
在odbc.ini中创建您的DSN:
[dbserverdsn]
Driver = FreeTDS
Server = dbserver.domain.com
Port = 1433
TDS_Version = 7.2
Run Code Online (Sandbox Code Playgroud)
...以及你在freetds.conf中的DSN:
[global]
# TDS protocol version, use:
# 7.3 for SQL Server 2008 or greater (tested through 2014)
# 7.2 for SQL Server 2005
# 7.1 for SQL Server 2000
# 7.0 for SQL Server 7
tds version = 7.2
port = 1433
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# If you get out-of-memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# Try setting 'text size' to a more reasonable limit
text size = 64512
# A typical Microsoft server
[dbserverdsn]
host = dbserver.domain.com
port = 1433
tds version = 7.2
Run Code Online (Sandbox Code Playgroud)
完成此操作后,您可以尝试连接tsql(以测试FreeTDS层)和isql(通过FreeTDS堆栈的unixODBC)来测试连接.
小智 9
apt-get是一个非常老的版本。获得更新的版本
sudo apt-get install wget
sudo apt-get install build-essential
sudo apt-get install libc6-dev
# find latest version of FreeTDS ftp://ftp.freetds.org/pub/freetds/stable/
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.92.tar.gz
tar -xzf freetds-1.00.92.tar.gz
cd freetds-1.00.92
./configure --prefix=/usr/local --with-tdsver=7.3
sudo make
sudo make install
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
38695 次 |
| 最近记录: |