myloader恢复主要流程
1、首先由myloader主线程完成建库建表,依次将备份目录下建库和建表文件执行应用到目标
数据库实例中;
2、接着myloader主线程会生成多个工作线程,由这些工作线程将所有database.table.*.sql文
件中的记录导入到对应表中,这个阶段是并行的,并行粒度为文件,工作线程完成所有
database.table.*.sql 文件数据导入后销毁;
3、最后主线程将创建函数、存储进程、事件,以及创建表视图、触发器的文件执行导入对应数
据库和表中。
常⽤参数介绍
myloader --help
Usage:
myloader [OPTION...] multi-threaded MySQL loader
Help Options:
-?, --help Show help options
Application Options:
-d, --directory Directory of the dump to import之前备份好
-q, --queries-per-transaction Number of queries per transaction, defau
-o, --overwrite-tables Drop tables if they already exist如果要恢
-B, --database An alternative database to restore into还
-s, --source-db Database to restore选择被还原的数据库,将这
-e, --enable-binlog Enable binary logging of the restore dat
-h, --host 连接的主机名
-u, --user 用来备份的用户名
-p, --password 用户密码
-P, --port 连接端口
-S, --socket 使用socket通信时的socket文件
-t, --threads 开启的备份线程数,默认是4
-C, --compress-protocol 压缩与mysql通信的数据
-V, --version 显示版本号
-v, --verbose 输出信息模式, 0 = silent, 1 = errors, 2 =
恢复流程图
23数据恢复实战
1. 导⼊表结构和数据
myloader -h xx.xx.xx.xx -P2883 -u 'user@tenantname#clustenamer' -p ****** -
2. 导⼊数据库(若⽬标库不存在则会新建)
myloader -h xx.xx.xx.xx -P2883 -u 'user@tenantname#clustenamer' -p ****** -
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交