我需要一个简单而完整的教程来从Ubuntu建立MSSQL连接。
我想我已经安装了FreeTDS和UnixODBC,但是配置非常复杂,我不理解这个问题。
我遵循了本教程:https : //github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Platform-Installation---Ubuntu
但是我失败了。
root@hackmachine:~# isql -v example.com XXXXX XXXXXXX
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
root@hackmachine:~#
编辑:
在此之前,“ / etc / odbcinst.ini”和“ /etc/odbc.ini”为空。
我将这些行添加到/etc/odbcinst.ini中:
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
CPTimeout =
CPReuse =
FileUsage = 1
我将这些行添加到/etc/odbc.ini中:
[project_development]
Driver = FreeTDS
Description = ODBC connection via FreeTDS
Trace = No
Servername = developer
Database = project_development
[project_test]
Driver = FreeTDS
Description = ODBC connection via FreeTDS
Trace = No
Servername = developer
Database = test
[project_production]
Driver = FreeTDS
Description = ODBC connection via FreeTDS
Trace = No
Servername = production
Database = project_production
从一开始,我就没有对“ /etc/freetds/freetds.conf”进行任何更改。
不过,什么都没有改变。