mydumper 备库备份注意事项
admin
2023-04-18 10:44:06
0
1、备库备份报错
 mydumper -u root  -p xxxx--trx-consistency-only -B test -T t1,t2 -o /backup/mysql/`date +%F`

** (mydumper:19792): WARNING **: Using trx_consistency_only, binlog coordinates will not be accurate if you are writing to non transactional tables.

** (mydumper:19792): CRITICAL **: There are queries in PROCESSLIST running longer than 60s, aborting dump,
    use --long-query-guard to change the guard value, kill queries (--kill-long-queries) or use 
    different server for dump

    2、解决方法
    添加一个-l 参数,设置足够大的值,可以顺利备份

    mydumper -u root  -p xxx --trx-consistency-only -l 99999999 -B test -T t1,t2 -o /backup/mysql/`date +%F`

    3、帮助文件
    [mysql@roidb01 ~]$ mydumper --help
Usage:
  mydumper [OPTION...] multi-threaded MySQL dumping

Help Options:
  -?, --help                  Show help options

Application Options:
  -B, --database              Database to dump
  -T, --tables-list           Comma delimited table list to dump (does not exclude regex option)
  -O, --omit-from-file        File containing a list of database.table entries to skip, one per line (skips before applying regex option)
  -o, --outputdir             Directory to output files to
  -s, --statement-size        Attempted size of INSERT statement in bytes, default 1000000
  -r, --rows                  Try to split tables into chunks of this many rows. This option turns off --chunk-filesize
  -F, --chunk-filesize        Split tables into chunks of this output file size. This value is in MB
  -c, --compress              Compress output files
  -e, --build-empty-files     Build dump files even if no data available from table
  -x, --regex                 Regular expression for 'db.table' matching
  -i, --ignore-engines        Comma delimited list of storage engines to ignore
  -N, --insert-ignore         Dump rows with INSERT IGNORE
  -m, --no-schemas            Do not dump table schemas with the data
  -d, --no-data               Do not dump table data
  -G, --triggers              Dump triggers
  -E, --events                Dump events
  -R, --routines              Dump stored procedures and functions
  -W, --no-views              Do not dump VIEWs
  -k, --no-locks              Do not execute the temporary shared read lock.  WARNING: This will cause inconsistent backups
  --no-backup-locks           Do not use Percona backup locks
  --less-locking              Minimize locking time on InnoDB tables.
  **-l, --long-query-guard      Set long query timer in seconds, default 60**
  -K, --kill-long-queries     Kill long running queries (instead of aborting)
  -D, --daemon                Enable daemon mode
  -I, --snapshot-interval     Interval between each dump snapshot (in minutes), requires --daemon, default 60
  -L, --logfile               Log file name to use, by default stdout is used
  --tz-utc                    SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones, defaults to on use --skip-tz-utc to disable.
  --skip-tz-utc               
  --use-savepoints            Use savepoints to reduce metadata locking issues, needs SUPER privilege
  --success-on-1146           Not increment error count and Warning instead of Critical in case of table doesn't exist
  --lock-all-tables           Use LOCK TABLE for all, instead of FTWRL
  -U, --updated-since         Use Update_time to dump only tables updated in the last U days
  --trx-consistency-only      Transactional consistency only
  --complete-insert           Use complete INSERT statements that include column names
  -h, --host                  The host to connect to
  -u, --user                  Username with the necessary privileges
  -p, --password              User password
  -a, --ask-password          Prompt For User password
  -P, --port                  TCP/IP port to connect to
  -S, --socket                UNIX domain socket file to use for connection
  -t, --threads               Number of threads to use, default 4
  -C, --compress-protocol     Use compression on the MySQL connection
  -V, --version               Show the program version and exit
  -v, --verbose               Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2
  --defaults-file             Use a specific defaults file
  --ssl                       Connect using SSL
  --key                       The path name to the key file
  --cert                      The path name to the certificate file
  --ca                        The path name to the certificate authority file
  --capath                    The path name to a directory that contains trusted SSL CA certificates in PEM format
  --cipher                    A list of permissible ciphers to use for SSL encryption

相关内容

热门资讯

强化技术引领场景培育政策保障 ... 5月11日,省长叶建春就脑机接口技术与产业创新工作开展专题调研。他强调,脑机接口是培育未来产业发展新...
上海交大王如竹教授领衔撰写的“... 4月30日,国际制冷学会(IIR,International Institute of Refrig...
非人类身份蔓延:智能体AI真正... 长期以来,企业依赖服务账户、API密钥、OAuth令牌等各类非人类身份凭证,使不同服务能够在数字环境...
脑机接口“狂飙” 从病房走向多... (记者 陈锦锋)当大脑的神经信号能够直接与外部设备对话,“心想事成”便从科幻走向现实。近日,中南大学...
中巴外长通话,王毅:希望巴方保... 2026年5月12日晚,中共中央政治局委员、外交部长王毅同巴基斯坦副总理兼外长达尔通电话。达尔介绍了...
美参议院投票批准凯文·沃什出任... △凯文·沃什(资料图)当地时间5月12日,美国参议院投票批准凯文·沃什出任美联储主席,目前相关投票程...
缺油!日本快撑不住了 日本零食巨头卡乐比为节省油墨竟将原本漂亮的包装改成了黑白两色,从“喜食”变得看上去像“丧食”。日本石...
英国首相斯塔默再遭逼宫,在内阁... 【文/观察者网 熊超然】在上周经历地方选举惨败后,作为执政党领袖的英国首相斯塔默于当地时间5月11日...
日防相声称:新西兰考虑进口日本... 据凤凰卫视报道,5月12日,日本防卫大臣小泉进次郎在记者会上表示,新西兰已将日本海上自卫队最上型改良...
小米YU7 GT“车厘子红”无... 5 月 12 日消息,博主 @王的男人、昨日晒出了小米 YU7 GT「车厘子红」实车照片。画面显示,...