首页 > 数据库 >【MySQL】MariaDB使用connect存储引擎访问SQLServer中的表

【MySQL】MariaDB使用connect存储引擎访问SQLServer中的表

时间:2022-08-31 11:11:21浏览次数:97  
标签:OK unixODBC SQLServer installed connect install MySQL 2.3

借助connect存储引擎,Mariadb可以访问任何ODBC数据源。 本文是以CentOS7为例。安装的内容有:ODBC driver,unixODBC

 

1.下载ODBC对应linux的驱动
下载地址:

https://docs.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server?view=sql-server-ver16

 

2.使用提供的脚本build_dm.sh安装unixODBC

bash build_dm.sh
....
The script is provided as a convenience to you as-is, without any express
or implied warranties of any kind.  Microsoft is not liable for any issues
arising out of your use of the script.

Enter 'YES' to have this script continue: YES

Verifying processor and operating system ................................... OK
Verifying wget is installed ................................................ OK
Verifying tar is installed ................................................. OK
Verifying make is installed ................................................ OK
Downloading unixODBC 2.3.0 DriverManager ................................... OK
Unpacking unixODBC 2.3.0 DriverManager ..................................... OK
Configuring unixODBC 2.3.0 DriverManager ................................... OK
Building unixODBC 2.3.0 DriverManager ...................................... OK
Build of the unixODBC 2.3.0 DriverManager complete.

Run the command 'cd /tmp/unixODBC.32235.28222.16428/unixODBC-2.3.0; make install' to install the driver manager.

然后安装

cd /tmp/unixODBC.32235.28222.16428/unixODBC-2.3.0; make install

如果发生依赖失败,可以执行:

yum install yum-utils && yum-builddep unixODBC

如果yum安装的是最新的包,驱动有可能失败。

 

3.安装MSSQL包

bash install.sh install

接受协议

Enter YES to accept the license or anything else to terminate the installation: YES

Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ................................. NOT FOUND
unixODBC utilities (odbc_config and odbcinst) installed ............ NOT CHECKED
unixODBC Driver Manager version 2.3.0 installed .................... NOT CHECKED
unixODBC Driver Manager configuration correct ...................... NOT CHECKED
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .. NOT CHECKED
Microsoft SQL Server ODBC Driver V1.0 for Linux files copied ................ OK
Symbolic links for bcp and sqlcmd created ................................... OK
Microsoft SQL Server ODBC Driver V1.0 for Linux registered ........... INSTALLED

也可以通过yum install unixODBC安装或更新。

可以通过/etc/odbcinst.ini查看MSSQL包是否存在。

 

4.安装connect引擎
在服务器上执行:

yum install MariaDB-connect-engine

登录mariadb执行:

INSTALL SONAME 'ha_connect.so';

 

5.创建表
根据文件/etc/odbcinst.ini的信息创建表:

CREATE TABLE mssql_table ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Driver=SQL Server Native Client 11.0;Server=ms-sql01;Database=old_version_migration_data;UID=mariadb;PWD=password' `TABLE_TYPE`='ODBC'

 

https://mariadb.com/resources/blog/getting-microsoft-sql-server-data-into-mariadb-with-the-connect-storage-engine/

 

 

标签:OK,unixODBC,SQLServer,installed,connect,install,MySQL,2.3
From: https://www.cnblogs.com/abclife/p/16639131.html

相关文章

  • MySql Replication主从环境搭建
    1、主库安装完毕之后,执行以下查询:SHOWVARIABLESLIKE'log_bin';SHOWVARIABLESLIKE'binlog_format';SHOWVARIABLESLIKE'server_id';SHOWVARIABLESLIKE'i......
  • MySQL 覆盖索引详解
    1.什么是索引?索引(在MySQL中也叫“键key”)是存储引擎快速找到记录的一种数据结构,通俗来说类似书本的目录,这个比方虽然被用的最多但是也是最恰如其当的,在查询书本中的某......
  • Canal 原理说明和Mysql+Canal+kafaka 按装说明
    Canal原理说明:主要应用场景Mysql与Redis可靠一致性,因为msyql修改变更将数据加到kafka队列可以确保存数据一定会被更新到redis,kafka有重试和可以确保被消费。使用阿里的......
  • MySQL刷题复习笔记 - 每日持续更新
    PS为了代码规范,所以所有关键字均为大写,其他为小写。点击题目名称即为题解链接。MySQL基本语法SELECT[DISTINCT]列名1,列名2...FROM表名WHERE查询条件表达......
  • springboot mysql 的赖配置
    1、报错点  ##mysqlspring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverspring.datasource.url=jdbc:mysql://127.0.01:3307/distributed-lock-test?......
  • 1.MySQL优化
    MySQL中的索引管理​ 在MySQL中,对索引的查看和删除操作是所有索引类型通用的。6.1普通索引​ 这是最基本的索引,它没有任何限制MyIASM中默认的BTREE类型的索......
  • [Bug0045]MySQL 8.0 Public Key Retrieval is not allowed 错误解决方式
    1、问题使用DBeaver连接MySQL8.0报错PublicKeyRetrievalisnotallowed2、场景电脑开发环境迁移初始化mysql后使用DBeaver连接不上3、原因查阅网上资料得到是......
  • JAVA入门基础_从零开始的培训_MYSQL基础
    目录1、数据库概述与MYSQL5.7、MYSQL8.0安装篇(基于Windows)MYSQL是什么,为什么要使用MYSQLMYSQL的四个版本MYSQL环境搭建MYSQL的安装与卸载Windows10下安装MYSQL8.26版......
  • JAVA入门基础_从零开始的培训_MYSQL高级
    目录第1章Linux下MySQL的安装与使用Linux下MYSQL的卸载安装MYSQL之前的准备步骤正式安装检查/tmp临时目录权限安装前检查依赖并卸载mariadb按照顺序依次安装MYSQL服务的初......
  • centos下mysql 最新版终于安装成功!备份一下几个关键地方
    我本来只是为了搭建简单的LAMP环境,亲自动手,却发现有这么多的问题会发生。(bydefault7#zbphp.com)很多地方给的安装Mysql的提示是通过yum一键安装。shell命令如下:yumins......