mysql - 使用 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 连接时,它只是因错误而失败。你能帮忙吗?谢谢
解决方案
推荐阅读
- ruby-on-rails - 在 Rails 中跟踪 sidekiq 作业
- c# - C# WPF 应用程序 - 在运行时修改数据表的问题 - System.ArgumentOutOfRangeException
- google-cloud-platform - Apache Beam 中的窗口函数
- python - Dask - map_partition
- spreadsheet - 有没有办法在 Google 表单中生成和显示唯一 ID?
- spring-boot - 尝试多对一实体映射时出现未知列错误
- bison - “轻松”转变/减少冲突
- python-3.x - 读取具有动态值的 sql 文件
- java - 错误:MainActivity.java 上需要类、接口或枚举
- c# - 如何为我的相机设置后期处理图层?