InnoDB Lock与MySQL Shell数据导入案例
##
InnoDB Lock与MySQL Shell数据导入案例
1、案例概述
今天遇到一个MySQL Shell数据导入案例,分享一下,数据来源于RDS,使用mysqlshell的dump schema获取数据,在数据库的导出过程中没有遇到任何错误或者警告,但是在导入本地数据库时出现问题,多次实验之后,数据导入过程百分比不同都会报错。错误信息如下:
MySQL localhost JS > util.loadDump('/mysql/backup/aaa', {threads: 16, deferTableIndexes: "all",ignoreVersion: true,characterSet:"utf8mb4"})
Loading DDL and Data from '/mysql/backup/aaa' using 16 threads.
Opening dump...
Target is MySQL 5.7.42-log. Dump was produced from MySQL 5.7.42-log
Scanning metadata - done
Checking for pre-existing objects...
Executing common preamble SQL
Executing DDL - done
Executing view DDL - done
Starting data load
ERROR: [Worker001]: ebdb@watchdog@9.tsv.zst: MySQL Error 1205 (HY000): Lock wait timeout exceeded; try restarting transaction: LOAD DATA LOCAL INFILE '/mysql/backup/ aaa/ebdb@watchdog@9.tsv.zst' REPLACE INTO TABLE `ebdb`.`watchdog` CHARACTER SET 'utf8mb4' FIELDS TERMINATED BY ' ' ESCAPED BY '\' LINES STARTING BY '' TERMIN ATED BY 'n' (`wid`, `uid`, `type`, `message`, @`variables`, `severity`, `link`, `location`, `referer`, `hostname`, `timestamp`) SET `variables` = FROM_BASE64(@`vari ables`)
ERROR: Aborting load...
1 thds loading 22% (1.36 GB / 5.93 GB), 30.05 MB/s, 301 / 301 tables done
333 chunks (2.31M rows, 1.36 GB) for 301 tables in 3 schemas were loaded in 35 sec (avg throughput 41.26 MB/s)
1 errors and 0 warnings messages were reported during the load.
Util.loadDump: Error loading dump (MYSQLSH 53005)