Mydumper Introduction:
1) Mydumper is a high performance multi-threaded backup and recovery tool for MySQL and drizzle
2) Features:
Lightweight C language Writing
10 times times faster execution speed than mysqldump
Fast File compression
Support Export Binlog
Multi-threaded recovery
Periodic snapshots and sequential binary logs in the way daemons work
Open source
Installation of Mydumper
[Email protected] ~]# yum-y install glib2-devel zlib-devel pcre-devel cmake
[Email protected] ~]# Tar XF mydumper-0.9.1.tar.gz
[[Email protected] ~] #cd mydumper-0.9.1
[[Email protected] ~] #cmake. && make && make install
Common options:
- -B libraries that need to be backed up
- -T tables that need to be backed up
- -O Output Directory
- -C Compressed Output file
- -m do not export table structure
- -B Export Binlog
- -D in daemon mode
- -H, --host
- -u, --user
- -P, --password
- -P, --Port
- -S, --socket
- -t, --threads number of threads used, default 4
Case:
[Email protected] mydumper-0.9.1]# mydumper-u root-p aa123456-h localhost-p 3306-s/tmp/mysql.sock-b wordpress-o/ tmp/bak/
[Email protected] mydumper-0.9.1]# cd/tmp/bak/
[email protected] bak]# LL
Total 18460
-rw-r--r--1 root root 137 Apr 11:56 metadata
-rw-r--r--1 root root 11:56 wordpress-schema-create.sql
-rw-r--r--1 root root 515 Apr 11:56 wordpress.wp_commentmeta-schema.sql
-rw-r--r--1 root root 2282 Apr 11:56 wordpress.wp_commentmeta.sql
-rw-r--r--1 root root 1576 Apr 11:56 wordpress.wp_comments-schema.sql
-rw-r--r--1 root root 12698 Apr 11:56 wordpress.wp_comments.sql
-rw-r--r--1 root root 251 Apr 11:56 Wordpress.wp_hermit_cat-schema.sql
-rw-r--r--1 root root 154 Apr 11:56 Wordpress.wp_hermit_cat.sql
-rw-r--r--1 root root 374 Apr 11:56 wordpress.wp_hermit-schema.sql
-rw-r--r--1 root root 530 Apr 11:56 Wordpress.wp_options-schema.sql
-rw-r--r--1 root root 873997 Apr 11:56 wordpress.wp_options.sql
-rw-r--r--1 root root 506 Apr 11:56 Wordpress.wp_postmeta-schema.sql
-rw-r--r--1 root root 2770950 Apr 11:56 wordpress.wp_postmeta.sql
-rw-r--r--1 root root 1903 Apr 11:56 Wordpress.wp_posts-schema.sql
-rw-r--r--1 root root 15144028 Apr 11:56 wordpress.wp_posts.sql
-rw-r--r--1 root root 485 Apr 11:56 wordpress.wp_termmeta-schema.sql
-rw-r--r--1 root root 432 Apr 11:56 Wordpress.wp_term_relationships-schema.sql
-rw-r--r--1 root root 2057 Apr 11:56 wordpress.wp_term_relationships.sql
-rw-r--r--1 root root 507 Apr 11:56 Wordpress.wp_terms-schema.sql
-rw-r--r--1 root root 2263 Apr 11:56 wordpress.wp_terms.sql
-rw-r--r--1 root root 661 Apr 11:56 wordpress.wp_term_taxonomy-schema.sql
-rw-r--r--1 root root 1270 Apr 11:56 Wordpress.wp_term_taxonomy.sql
-rw-r--r--1 root root 505 Apr 11:56 Wordpress.wp_usermeta-schema.sql
-rw-r--r--1 root root 1870 Apr 11:56 Wordpress.wp_usermeta.sql
-rw-r--r--1 root root 1022 Apr 11:56 wordpress.wp_users-schema.sql
-rw-r--r--1 root root 247 Apr 11:56 Wordpress.wp_users.sql
Description
Metadata: Metadata, record backup start and end time, binlog log file location
Table data one file per table
Table schemas tables structure file
-rw-r--r--1 root root 1022 Apr 11:56 wordpress.wp_users-schema.sql
-rw-r--r--1 root root 247 Apr 11:56 Wordpress.wp_users.sql
Binary log: When the--binlogs option is enabled, the binaries are stored in the Binlog_snapshot directory
Restoring a Database
You must first establish a database and then use the Myloader command
Myloader-u root-paa123456-h localhost-p 3306-s/tmp/mysql.sock-b wordpress-d/tmp/bak/
MySQL database multi-threading Backup tool Mydumper