首页 > 解决方案 > 使用 CONNECT 引擎和 unixODBC 从 MariaDB 连接到 MSSQL 时出现登录超时错误

问题描述

我在 Mariadb 10.4.13 上,正在尝试从 MSSQL 2016 标准版服务器中提取数据。我下载并安装了 unixODBC 并使用以下说明配置了 CONNECT 引擎插件 - https://mariadb.com/resources/blog/getting-microsoft-sql-server-data-into-mariadb-with-the-connect-storage-引擎/

当我尝试从 Mariadb 连接到 MSSQL 以提取数据时,它失败并出现“登录超时”错误。
UnixODBC 驱动程序正在工作,因为我能够通过 sqlcmd 建立连接。它只是无法通过 MariaDB 数据库和 CONNECT 引擎工作。你能帮忙吗?
谢谢

[root@stage plugin]# cat /etc/odbcinst.ini
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1
[root@stage sqlncli-11.0.1790.0]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2327
Server version: 10.4.13-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mdtest;
Database changed

MariaDB [mdtest]> CREATE TABLE temp_BB ENGINE=CONNECT tabname='temp_BB' CONNECTION='Driver=SQL Server Native Client 11.0;Server=10.10.x.x;Database=ACS_test;UID=yser1;PWD=mypass' TABLE_TYPE='ODBC' ;
ERROR 1105 (HY000): SQLDriverConnect: [unixODBC][Microsoft][SQL Server Native Client 11.0]Login timeout expired
MariaDB [mdtest]>
[root@stage-app-1 plugin]# sqlcmd -D -S c-mssql -U user1 -d ACS_test -P mypass -Q "select count(*) from temp_bb;"

-----------
        108

(1 rows affected)
[root@stage-app-1 plugin]# cat /etc/odbc.ini
[c-mssql]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Server=10.10.x.x
Port=1433
NeedODBCTypesOnly = 1
[root@stage-app-1 plugin]#

Login Timeout Expired通过 MariaDB 连接时,它只是因错误而失败。你能帮忙吗?谢谢

标签: mysqlsql-servermariadbunixodbcmariadb-connect-engine

解决方案


推荐阅读