使用UnixODBC和FreeTDS连接到ubuntu中的Pervasive SQL服务器?

时间:2016-05-08 19:38:07

标签: freetds unixodbc pervasive-sql

我正在尝试从Ubuntu 14.04.4服务器连接到Windows 10上运行的Pervasive Sql Server。

我正在使用以下服务尝试连接到服务器:

FreeTDS
unixODBC

在开始之前,我尝试从vm控制台成功ping主机。

然后我运行以下命令检查FreeTDS是否已正确安装;

tsql -C

返回了:

Compile-time settings (established with the "configure" script)
                        Version: freetds v0.95.95
         freetds.conf directory: /usr/local/etc
 MS db-lib source compatibility: no
    Sybase binary compatibility: no
                  Thread safety: yes
                  iconv library: yes
                    TDS version: 5.0
                          iODBC: no
                       unixodbc: yes
          SSPI "trusted" logins: no
                       Kerberos: no
                        OpenSSL: no
                         GnuTLS: no
位于[/ usr / local / etc]中的

[freetds.conf]包含:

[PSQLServer]
host        = **IP**
port        = **PORT**
tds version = 8.0
位于[/ usr / local / etc]的

[odbc.ini]包含:

[PSQLClient]
Description = Pervasive SQL Client Settings
Driver      = FreeTDS
ServerName  = PSQLServer
Database    = **DBNAME**
Trace       = No
UID         = **USERNAME**
PWD         = **PASSWORD**
TDS_Version = 8.0
位于[/ usr / local / etc]中的

[odbcinst.ini]包含:

[FreeTDS]
Description = FreeTDS unixODBC Driver
Driver      = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup       = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
TDS_Version = 8.0

我厌倦了使用tsql命令为每个可能的驱动程序版本添加[TDSVER = *],导致每个TDSVER出现相同的错误消息。

* [5.0],* [6.0],* [7.0],* [7.1],* [7.2],* [7.3],* [7.4],* [8.0]

使用以下命令测试连接时:

TDSVER=8.0 tsql -S PSQLClient -U **USERNAME** -P **PASSWORD**

返回以下错误:

Error 20012 (severity 2):
        Server name not found in configuration files.
locale is "en_ZA.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Error 20013 (severity 2):
        Unknown host machine name.
There was a problem connecting to the server

尝试上述操作后,我尝试使用isql命令:

isql -v PSQLClient **USERNAME** **PASSWORD**

返回以下错误消息:

[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[01000][unixODBC][FreeTDS][SQL Server]Unknown host machine name.
[ISQL]ERROR: Could not SQLConnect

甚至可以通过[node-odbc]连接到[Pervasive SQL],如果是这样,我做错了什么?

非常感谢任何帮助!

1 个答案:

答案 0 :(得分:4)

Pervasive / Actian PSQL的最新版本支持Linux客户端,并具有适用于Linux的ODBC驱动程序。由于您使用的是Windows 10,因此您应该使用PSQL v12。如果您使用v12,则可以在http://www.pervasive.com/database/Home/Products/PSQLv12.aspx下载Linux客户端。有RPM和TAR可用。

相关问题