Home > Database > Mysql Tutorial > body text

Example explanation of myloader principle

PHP中文网
Release: 2017-06-20 15:34:54
Original
1679 people have browsed it
Myloader recovery main process
1. First, the main thread of myloader completes the database and table creation, and then creates the backup directory in sequence. The library and table creation files are executed and applied to the target database instance;
2. Then the myloader main thread will generate multiple worker threads, and these worker threads will all database.table.*. The records in the sql file are imported into the corresponding table. This stage is parallel, and the parallel granularity is file. The working thread completes the import of all database.table.*.sql file data and then destroys it;
3. Finally, the main thread will create functions, stored processes, events, and create table views and trigger files and import them into the corresponding databases and tables.
Detailed explanation of myloader parameters
myloader --helpUsage:
  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, default 1000每次事物执行的查询数量,默认是1000
  -o, --overwrite-tables            Drop tables if they already exist如果要恢复的表存在,则先drop掉该表,使用该参数,需要备份时候要备份表结构
  -B, --database                    An alternative database to restore into还原到指定的数据库
  -s, --source-db                   Database to restore选择被还原的数据库,将这个数据库数据还原到--database指定的数据库里
  -e, --enable-binlog               Enable binary logging of the restore data启用还原数据的二进制日志
  -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 = warnings, 3 = info, 默认为2
Copy after login
myloader recovery flow chart

The above is the detailed content of Example explanation of myloader principle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template