?????????????????????test????????10??10000000?м??????
????sysbench --test=/data/software/sysbench-0.5/sysbench/tests/db/oltp.lua --mysql-table-engine=innodb --oltp-table-size=10000000 --max-requests=10000
????--num-threads=100 --oltp_tables_count=10 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=admin --mysql-password=Dmjxjbgc6u
????--mysql-db=test --max-time=600 --mysql-socket=/tmp/mysql3306.sock prepare
???????????
????1.mysqlpump???????test?????(21G)??????????????????????2m42.515s??gzip????????LZ4??
????time mysqlpump -uroot -p -h127.0.0.1 --single-transaction --default-character-set=utf8 --compress-output=LZ4 --default-parallelism=3 -B test
????2.mysqldump???????test?????(21G)?????????28m9.930s??gzip????????LZ4??
????time mysqldump -uroot -p -h127.0.0.1 --default-character-set=utf8 -P3306 --skip-opt --add-drop-table --create-options --quick --extended-insert --single-transaction -B test | gzip > /data/mysql/mysql3306/data/test_db.sql.gz
????3.mydumper???????test?????(21G)???????????????????????10m10.207s??gzip????????LZ4??
????time mydumper -u test -h 127.0.0.1 -p safe2016 -P 3306 -t 3 -c -B test -o /data/mysql/mysql3306/data/
????4.mydumper???????test?????(21G)????????????????????????????????????chunk?????????????????????10m9.518s
????time mydumper -u test -h 127.0.0.1 -p safe2016 -P 3306 -t 3 -r 300000 -c -B test -o /data/mysql/mysql3306/data/
?????????濴????mysqlpump?????Ч???????mydumper?????mysqldump???????IO?????????£????????????????????????mysqlpump??????????????б??????mydumper????????????????????п?
??????????????????????????????????????ο?????????????????б?????????????????IO?????????????÷?????????б??????????????????????????
???????
????mysqldump??mysqlpump????÷???????????£?mysqlpump?μ??????????????????????????????????????????????????????2??????????
??????Щ???????????????????xtrabackup?????????????????в??????????????????????????б????
????MySQL5.7?????????????????mysqlpump??????mysqldump???????????mysqldump?????????????????mysqlpump??????????Щ?????????????????????????????????????????
????mysqlpump??mysqldump???????????????????????SQL???????????檔???????????????????????????undo log???С??????????????ɡ??????????????
????????б???????????????е???????????????
???????????????????????????????洢???????????????????
????????????????????????????CREATE USER??GRANT????????????????MySQL?????????
?????????????????????????????????
?????????????????????????
???????????????????????????????????????????????????????????????????????????????
???????????????????????????
?????????????????????mysqldump??£?????????
????1??--add-drop-database????????????????????????
????DROP DATABASE IF EXISTS `...`;2??--add-drop-table??????????????????????
????DROP TABLE IF EXISTS `...`.`...`;3??--add-drop-user????CREATE USER?????????DROP USER?????????????????--users??????????????Ч??
????DROP USER 'backup'@'192.168.123.%';4??--add-locks?????????????LOCK TABLES??UNLOCK TABLES???????????????????б????????????б???????--default-parallelism=0
????LOCK TABLES `...`.`...` WRITE;...
????UNLOCK TABLES;5??--all-databases?????????п?-A??
????6??--bind-address???????????????????????Mysql?????????????????????ж??IP????????????????????????
????7??--complete-insert??dump???????????е?????insert???
????8??--compress?? ??????????????????????е??????-C??
????9??--compress-output???????????????????????????????LZ4??ZLIB??
????shell> mysqlpump --compress-output=LZ4 > dump.lz4
????shell> lz4_decompress dump.lz4 dump.txt
????shell> mysqlpump --compress-output=ZLIB > dump.zlib
????shell> zlib_decompress dump.zlib dump.txt10??--databases????????????????????????????????-B??
????11??--default-character-set?????????????????
????12??--default-parallelism?????????????????????2????????ó?0?????????ò??б?????????????????????????create table??????????????????????????create table???????????д?????????????????????
????13??--defer-table-indexes?????????????????????????????????????????????????????????????mysqldump?????????????????????????????????????????????????????????????????????????????Ч???????????ò?????--skip--defer-table-indexes??
????14??--events??????????????????????????????--skip-events??????
????15??--exclude-databases??????????ò????????????????????????????????--exclude-events??--exclude-routines??--exclude-tables??--exclude-triggers??--exclude-users??
????mysqlpump --exclude-databases=mysql??sys #???????mysql??sys?????
????mysqlpump --exclude-tables=rr??tt #??????????????????rr??tt??
????mysqlpump -B test --exclude-tables=tmp_ifulltext??tt #???????test???е?rr??tt??
????...??????????????????????????????--users?????????????????е???????磺
????mysqlpump --users --exclude-databases=sys??mysql??db1??db2 --exclude-users=dba??backup #?????dba??backup??????????16??--include-databases?????????????????????????????????--include-events??--include-routines??--include-tables??--include-triggers??--include-users?????·???????15??