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

Using UnixODBC and FreeTDS to connect to Pervasive SQL server in ubuntu?

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

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

FreeTDS
unixODBC

在开始之前,我尝试从虚拟机控制台 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

[freetds.conf] 位于 [/usr/local/etc] 包含:

[PSQLServer]
host        = **IP**
port        = **PORT**
tds version = 8.0

[odbc.ini] 位于 [/usr/local/etc] 包含:

[PSQLClient]
Description = Pervasive SQL Client Settings
Driver      = FreeTDS
ServerName  = PSQLServer
Database    = **DBNAME**
Trace       = No
UID         = **USERNAME**
PWD         = **PASSWORD**
TDS_Version = 8.0

[odbcinst.ini] 位于 [/usr/local/etc] 包含:

[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**

其中returns错误如下:

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**

其中returns错误信息如下:

[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] 吗?如果可以,我做错了什么?

如有任何帮助,我们将不胜感激!

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