我尝试使用“Attunity Replicate for Microsoft Migrations (Replicate MSM)”将数据从Amazon RDS MySQL迁移到Azure Database for MySQL 。
为此,我在本地 Windows 10 机器上设置了 Replicate MSM 工具,然后定义和测试源和目标数据库端点,例如。RDS 作为源,Azure 作为目标,安装所需的 mysql、odbc 驱动程序并在两个数据库上启用二进制日志记录、local-infile 参数。但是现在当我运行迁移任务时,它只会在目标数据库上创建迁移表的模式,并且在“加载数据本地文件”命令中失败。这是堆栈跟踪:
00014468: 2019-06-20T11:17:41 [SOURCE_UNLOAD ]I: Unload finished for table 'TestDb'.'Employee' (Id = 1). 2000 rows sent. (streamcomponent.c:2892)
00014968: 2019-06-20T11:17:41 [TARGET_LOAD ]I: Loading table 'migrationtesting'.'Employee' with parallel threads (odbc_endpoint_imp.c:5256)
00014968: 2019-06-20T11:17:41 [TARGET_LOAD ]I: Use parallel load thread pool with '3' threads (csv_target.c:280)
00014968: 2019-06-20T11:17:42 [TARGET_LOAD ]I: Load finished for table 'TestDb'.'Employee' (Id = 1). 2000 rows received. 0 rows skipped. Volume transfered 904960 (streamcomponent.c:3116)
00014968: 2019-06-20T11:17:43 [TARGET_LOAD ]E: Failed to execute statement: 'load data local infile "C:\\Program Files\\Attunity\\ReplicateMSM\\data\\tasks\\Aws2Azure\\data_files\\1\\LOAD00000001.csv" into table `migrationtesting`.`Employee` CHARACTER SET UTF8 fields terminated by ',' enclosed by '"' lines terminated by '\n'( `id`,`name`,`gender`,`mobile`,`city` ) ;' [1022502] (ar_odbc_stmt.c:4349)
00014968: 2019-06-20T11:17:43 [TARGET_LOAD ]E: RetCode: SQL_ERROR SqlState: HY000 NativeError: 1148 Message: [MySQL][ODBC 5.3(w) Driver][mysqld-5.6.39.0]The used command is not allowed with this MySQL version [1022502] (ar_odbc_stmt.c:4355)
00007376: 2019-06-20T11:17:43 [TASK_MANAGER ]W: Table 'TestDb'.'Employee' (subtask 1 thread 1) is suspended (replicationtask.c:2050)
00014968: 2019-06-20T11:17:43 [TARGET_LOAD ]E: Failed to start load process for file '1' [1022502] (csv_target.c:1350)
00007376: 2019-06-20T11:17:43 [TASK_MANAGER ]I: All tables are loaded. Full load only task is stopped (replicationtask.c:2992)
00014968: 2019-06-20T11:17:43 [TARGET_LOAD ]E: Failed to load file '1' [1022502] (csv_target.c:1418)
00014968: 2019-06-20T11:17:43 [TARGET_LOAD ]E: Failed to load data from csv file. [1022502] (odbc_endpoint_imp.c:5331)
根据 Azure 文档:
支持 LOAD DATA INFILE,但必须指定 [LOCAL] 参数并将其定向到 UNC 路径(通过 SMB 装载的 Azure 存储)。
如果这是解决方案,请解释如何实现它。
注意:RDS 和 AZURE 上的 MySQL 服务器版本均为 5.6