· 8 years ago · Dec 08, 2017, 05:20 PM
1MySQL Enterprise Backup version 3.6.0 [2011/07/20]
2Copyright (c) 2003, 2011, Oracle and/or its affiliates. All Rights Reserved.
3Usage:
4 mysqlbackup [STD-OPTIONS]
5 [CONNECTION-OPTIONS]
6 [SERVER-REPOSITORY-OPTIONS]
7 [BACKUP-REPOSITORY-OPTIONS]
8 [--compress] [--compress-level=LEVEL]
9 [--include=REGEXP] [--with-timestamp] [--slave-info]
10 [--databases=LIST] [--databases-list-file=PATH]
11 [--suspend-at-end] [--sleep=MS]
12 [--exec-when-locked='utility arg1 arg2 ...']
13 [--incremental --start-lsn=LSN --incremental-backup-dir=PATH]
14 [--only-known-file-types] [--only-innodb]
15 [--no-history-logging] [--no-locking]
16 [--backup-dir=PATH]
17 [--comments=STRING]
18 [--comments-file=PATH]
19 [--backup-image=IMAGE]
20 [--sbt-database-name=NAME]
21 [--sbt-lib-path=PATH]
22 backup | backup-and-apply-log | backup-to-image
23
24 mysqlbackup [STD-OPTIONS]
25 [--limit-memory=MB] [--uncompress] [--backup-dir=PATH]
26 apply-log
27
28 mysqlbackup [STD-OPTIONS]
29 [--incremental-backup-dir=PATH] [--backup-dir=PATH]
30 [--limit-memory=MB]
31 apply-incremental-backup
32
33 mysqlbackup [STD-OPTIONS]
34 [SERVER-REPOSITORY-OPTIONS]
35 [--backup-dir=PATH]
36 copy-back
37
38 mysqlbackup [STD-OPTIONS]
39 [--backup-image=IMAGE] [--backup-dir=PATH]
40 image-to-backup-dir
41
42 mysqlbackup [STD-OPTIONS]
43 [--backup-dir=PATH] [--backup-image=IMAGE]
44 backup-dir-to-image
45
46 mysqlbackup [STD-OPTIONS]
47 [--backup-image=IMAGE] [--src-entry=PATH]
48 list-image
49
50 mysqlbackup [STD-OPTIONS]
51 [--backup-image=IMAGE]
52 [--backup-dir=PATH]
53 [--src-entry=PATH] [--dst-entry=PATH]
54 extract
55
56 Standard Options [STD-OPTIONS]:
57 -------------------------------
58 Following standard options may be given as the first argument(s):
59 --print-defaults --no-defaults --defaults-file=PATH
60 --defaults-extra-file=PATH --defaults-group-suffix=string
61
62 Other standard options are:
63 --help Display this help.
64 --version Display version information.
65 --verbose Print more verbose information.
66 --debug Print debug information.
67 --force By default, both backup and restore operation will refuse
68 to overwrite data/log files. The --force option can be
69 used to force overwriting the destination file.
70
71 Connection Options [CONNECTION-OPTIONS]:
72 ----------------------------------------
73 -u, --user=name Database user name to connect.
74 --port=# TCP portnumber to connect to.
75 --protocol=name Connection protocol: tcp|socket|pipe|memory.
76 -p, --password[=string] Connection password. If -p option used or
77 if password not given, it is prompted from
78 std input terminal.
79 --host=name Host name to connect.
80 --socket=name Socket file to use to connect.
81 --connect_timeout Connection timeout in seconds.
82 --character-sets-dir=PATH Directory for character set files.
83 --default-character-set=name
84 Set the default character set.
85 --secure-auth Refuse client connecting to server if it
86 uses old (pre-4.1.1) protocol.
87 --no-connection Do not connect to server. When specified,
88 implies following options:
89 --no-history-logging and --no-locking
90 --connect-if-online Use connection only if available.
91
92 Server Repository Options [SERVER-REPOSITORY-OPTIONS]:
93 ------------------------------------------------------
94 --datadir=PATH Path to mysql server data directory.
95 --innodb_data_file_path=VALUE Specify InnoDB system tablespace
96 files path and size.
97 --innodb_data_home_dir=PATH Specify base dir for all InnoDB data
98 files in the system shared tablespace.
99 --innodb_log_group_home_dir=PATH The dir path to InnoDB log files.
100 --innodb_log_files_in_group=N The number of InnoDB log files.
101 --innodb_log_file_size=SIZE The size in bytes of each InnoDB
102 log file in the log group.
103
104 Note: If connection to server is available, the above server repository
105 parameters will be obtained from connection and the values from
106 command line and configuration files will be ignored.
107
108 Backup Repository Options [BACKUP-REPOSITORY-OPTIONS]:
109 ------------------------------------------------------
110 --backup_dir=PATH
111 The backup directory path.
112
113 --backup_innodb_data_file_path=VALUE
114 Specify Innodb system tablespace files path & size in backup.
115
116 --backup_innodb_data_home_dir=PATH
117 Backup base dir for all InnoDB data files in the system
118 tablespace. By default, it is same as backup-dir.
119
120 --backup_innodb_log_group_home_dir=PATH
121 Backup dir for InnoDB log files.
122 By default, it is same as backup-dir.
123
124 --backup_innodb_log_files_in_group=N
125 Number of InnoDB Log files in backup. By default, it assumes
126 the number of innodb log files in server.
127
128 --backup_innodb_log_file_size=SIZE
129 The size in bytes of each InnoDB backup log file. By default,
130 it assumes the innodb log file size in server.
131
132 --incremental_backup_dir=PATH
133 The backup directory path for incremental backup.
134 There is no default value.
135
136 Other Options:
137 --------------
138 --compress Create backup in compressed format.
139 --compress-level=LEVEL
140 Specify value from 0-9.
141 Specify value 0 to disable compression.
142 Specify value 1 for fastest compression.
143 Specify value 9 for best compression.
144
145 --uncompress
146 When used with apply-log operation, uncompresses the
147 compressed backup before applying log.
148
149 --incremental --start-lsn=LSN --incremental-backup-dir=PATH
150 To take incremental backup, the above 3 options should
151 be specified together. All innodb data modified after
152 given lsn is copied in the incremental backup.
153 Example: --incremental --start-lsn=12345
154 --incremental-backup-dir=/var/mysql/backup/inc
155
156 Note: By default, all non-innodb & .frm files are also
157 included in incremental backup.
158 To exclude non-innodb data in incremental backup,
159 use --only-innodb option.
160
161 --include=REGEXP
162 Backup only those per-table innodb data files which match
163 the regular expression (REGEXP). For each table with a
164 per-table data file, a string of the form db_name.table_name
165 is checked against the regular expression (REGEXP). If the
166 REGEXP matches db_name.table_name, the table is included.
167 The REGEXP should be of POSIX 1003.2 'extended' form.
168
169 --with-timestamp
170 The backup is stored in a subdirectory of the given
171 backup-dir whose name is formed using current timestamp.
172 Useful to maintain single backup-dir which stores
173 many backup snapshots in it's subdirectories.
174
175 --limit-memory=MB
176 This option is relevant only when apply-log operation is
177 performed. Specifies max memory size used in recovery.
178 The default value of 100 implies 100MB.
179 Example: --limit-memory=50 would limit the usage to 50MB.
180
181 --slave-info
182 This option is useful when backing up a replication
183 slave server. It prints the binary log position and
184 name of the binary log file of the master server.
185 It also writes this information to the 'ibbackup_slave_info'
186 file as a 'CHANGE MASTER' command. A new slave for this
187 master can be set up by starting a slave server on this
188 backup and issuing a 'CHANGE MASTER' command with the
189 binary log position saved in the 'ibbackup_slave_info' file.
190
191 --databases=LIST
192 This option is used to filter the list of non-innodb
193 tables that needs to be backed up. To filter innodb tables,
194 use --include option.
195 The argument specifies space separated list of database/table
196 names of the following form:
197 "db_name[.table_name] db_name1[.table_name1] ...".
198 If this option is not specified all databases will be
199 backed up. Also, if the specified database does not match
200 with any single database/table, then all databases will be
201 backed up.
202
203 --databases-list-file=PATH
204 This option is used to filter the list of non-innodb
205 tables that needs to be backed up.
206 The specified file contains entries for databases/tables
207 separated by newline or space. The format of the entries,
208 is same as that for --databases option:
209 db_name[.table_name]
210 db_name1[.table_name1]
211 ...
212 If this option is not specified all databases will be
213 backed up. Also, if the specified entries do not match
214 with any single database/table, then all databases will be
215 backed up.
216 --suspend-at-end
217 Using this option makes mysqlbackup to do the following:
218 After copying of innodb data is done, it creates a file
219 called 'ibbackup_suspended' in the specified backup log
220 group home dir; It waits until user deletes that file.
221
222 Note that it locks all tables before suspending unless
223 locking is specifically disabled (by --no-locking) option
224 or connection is not applicable (e.g. --no-connection).
225 Also note that when --only-innodb option is used no locking
226 is applicable, hence suspension happens without locking.
227 So this option is useful to customize locking behavior
228 and backup of non-innodb files using external programs.
229 For example, the locking of tables may be delayed if other
230 important applications are running. Used with --only-innodb
231 option, the external program may dynamically decide what
232 non-innodb data should be backed up. The external program
233 would delete the 'ibbackup_suspended' file after doing it's
234 job to signal mysqlbackup to continue.
235
236 --sleep=MS Time to sleep in milliseconds after copying each 1MB of data.
237 Example: --sleep=10 causes delay of 10ms for each 1MB.
238
239 --exec-when-locked="utility arg1 arg2 ..."
240 The specified utility is executed when all tables are
241 locked near the end of the execution. This can be used
242 to mysqldump memory tables (engine=memory) and get a
243 consistent backup.
244 The BACKUP_DIR environment variable is set to point to
245 the current backup directory to be accessible for the
246 utility.
247 For example, in Unix like systems:
248 --exec-when-locked='mysqldump mydb t1 > $BACKUP_DIR/t1.sql'
249 Note the single quotes that prevent your shell from
250 interpreting $BACKUP_DIR before starting mysqlbackup.
251 In Windows systems:
252 --exec-when-locked="mysqldump mydb t1 > %BACKUP_DIR%/t1.sql"
253 If the utility cannot be executed or if it returns
254 failure (non-zero exit status), then the whole backup
255 process will be aborted.
256 If --suspend-at-end option is also used, then the utility
257 is executed before suspending.
258
259 --only-known-file-types
260 Backup only files of InnoDB, MyISAM, ARCHIVE and CSV engines.
261 With this option the backup contains:
262 InnoDB data and log files, table definitions (.frm files),
263 merge tables (.MRG), MyISAM tables and indexes (.MYD and
264 .MYI), triggers (.TRG and .TRN), database characteristics
265 (.opt), partitions (.par), ARCHIVE tables (.ARM and .ARZ)
266 and CSV tables (.CSV and .CSM).
267
268 --only-innodb
269 Backup only InnoDB data and log files. All .frm files and
270 files created by other storage engines are excluded.
271
272 --no-history-logging
273 Disable history logging even if connection is available.
274 By default, backup progress is logged in history table when
275 connection to server is available.
276
277 --no-locking
278 Disable locking of tables even if connection is available.
279 Can be used to copy non-innodb data without locking.
280 User accepts possible inconsistencies in non-innodb data.
281
282 --backup-image=IMAGE
283 Specify the path name of the backup image.
284
285 --comments=STRING
286 Specify comments string. It will be saved in a file
287 comments.txt in the backup.
288
289 --comments-file=PATH
290 Specify path to comments file. It will be saved as a file
291 comments.txt in the backup.
292
293 --backup-image=IMAGE
294 Specify the path name of the backup image.
295 IMAGE can be prefixed with 'file:' for file I/O.
296 IMAGE can be prefixed with 'sbt:' for SBT I/O.
297 The default is file I/O.
298
299 --sbt-database-name=NAME
300 If SBT I/O is selected, this can be used as a hint to
301 the Media Management Software (MMS) for the selection of
302 media and policies. This name has nothing to do with
303 MySQL database names. It is a term used by the MMS.
304
305 --sbt-lib-path=PATH
306 Path name of the SBT library (the MMS SBT API provider).
307 If this is not specified, operating system specific
308 search methods are used to locate 'libobk.so' (UNIX) or
309 'orasbt.dll' (Windows).
310
311 --disable-manifest
312 Disable generation of manifest files for a backup operation,
313 which are backup_create.xml and backup_content.xml present
314 in 'meta' directory.
315
316 --src-entry=PATH
317 This is useful for selective extraction of backup image.
318 This option specifies single file or single directory
319 entry in the backup image. When this option is used with
320 extract command for selecting a directory, all contents
321 including all subdirectories are recursively extracted.
322 In addition, --dst-entry=PATH option may be used only if
323 choosing different non-default destination PATH is desired.
324 Otherwise, use of this option does not require specifying
325 --dst-entry option. The specified path is simple path name
326 and no patterns or regular expressions are allowed.
327
328 --dst-entry=PATH
329 This option is useful for selective extraction of backup image
330 to extract single file or directory into user specified PATH.
331 Use of this option requires specifying --src-entry option.
332 This option specifies destination path for the selected entry
333 in backup image corresponding to entry specified by
334 -src-entry=PATH option.
335 The entry could point to single file or single directory.
336 For example, to retrieve comments file of backup image
337 into /tmp/my-comments.txt, use following command:
338
339 mysqlbackup --src-entry=meta/comments.txt
340 --dst-entry=/tmp/my-comments.txt
341 --backup-image=/var/myimage.bki extract
342
343 Similarly, if user wants to extract all the contents of
344 meta directory in image to /data/my-meta directory in
345 local file system, use following command:
346
347 mysqlbackup --src-entry=meta
348 --dst-entry=/data/my-meta
349 --backup-image=/var/myimage.bki extract
350
351 Note that the specified path is simple path name
352 and no patterns or regular expressions are allowed.
353
354
355 Following operations are supported:
356 -----------------------------------
357 backup
358 The command performs backup to the backup directory.
359 The result is the raw backup. The apply-log operation
360 must be done on the backup snapshot before it can be
361 used to restore.
362
363 backup-to-image
364 The command performs backup to single backup image.
365 The result is the raw backup image. The apply-log operation
366 must be done before backup can be used to restore.
367
368 apply-log
369 The command takes existing backup directory snapshot as input
370 and expands/transforms innodb data and log files as needed to
371 prepare for restore. If the original backup had been taken
372 in compressed format, the --uncompress option should be used
373 during apply-log operation. In order to do apply-log for
374 backup image file, it must be extracted to backup directory
375 first.
376
377 backup-and-apply-log
378 The command performs backup to the backup directory and
379 also performs the apply-log operation on the backup snapshot.
380 The result is the backup which is ready for restore.
381 This command always produces uncompressed backup.
382
383 apply-incremental-backup
384 The command applies incremental backup on full backup.
385 The incremental backup is primarily designed for innodb data.
386 Incremental backup contains innodb data changes and may also
387 include full-backup of non-innodb data files and .frm files.
388 Any non-innodb data in incremental backup is copied to server
389 repository over-writing same files if needed. Unknown
390 non-innodb files in server repository will not be touched
391 by this operation.
392
393 copy-back
394 The command restores data, index, log files from backup
395 directory to server repository. The restore operation
396 assumes the server is offline. Use of this command when
397 server is running is not supported.
398
399 image-to-backup-dir
400 The command extracts the given backup image contents to
401 specified backup directory.
402
403 backup-dir-to-image
404 The command creates backup image given the backup directory.
405
406 list-image
407 The command lists the contents of the given backup image.
408 The --src-entry option can be used to filter the output
409 to list the specific file or directory.
410
411 extract
412 The command extracts the contents of given backup image.
413 By default all entries with relative path names are extracted
414 into current working directory; all entries with absolute path
415 names are extracted into same absolute path names.
416 If --backup-dir=path option is specified, then specified
417 directory is used instead of current working directory to
418 extract entries with relative path names.
419 The --src-entry=path option can be used for selective
420 extraction to extract only one specific file or directory.
421 The --dst-entry=path option can be used along with
422 --src-entry option to extract specific file or directory
423 into user specified path name. See the specific notes on these
424 options for more details.
425
426 Description:
427
428 This program can be used to take online backup of MySQL database.
429 This can be primarily used to take hot backup of InnoDB tables.
430 This can also backup MyISAM and other non-innodb tables, however that
431 is performed by locking tables using connection. The backup of
432 other non-innodb & non-myisam tables taken is not guaranteed to be
433 consistent.
434
435 The program takes input parameters from my.cnf (or my.ini on windows)
436 configuration file(s) detected from default locations or from the given
437 configuration file specified using --defaults-file=<path> option.
438 The [mysqlbackup] and [client] groups parameters are read from the
439 configuration file. The command line options override options
440 specified in configuration file.
441
442 The backup and restore involves conceptually 3 steps:
443 (1) backup operation.
444 (2) Apply log operation to prepare backup for restore.
445 (3) copy-back operation to restore backup to server repository.
446 The backup-and-apply-log operation combines the above steps 1 and 2.
447
448 Creating compressed backup is supported where innodb data will be
449 created in compressed format. The compressed backup should be
450 uncompressed during apply-log operation (using --uncompress option).
451
452 Incremental backups are supported. Given the start log sequence number
453 (start-lsn), all innodb data pages whose latest modification has a
454 lsn greater than start-lsn are copied for incremental backup.
455 By default, incremental backup also copies all non-innodb data files
456 and .frm files. To backup only innodb incremental data, use the
457 --only-innodb option along with --incremental option.
458 Note that incremental backups are always taken in uncompressed format.
459
460 The CONNECTION-OPTIONS mentioned earlier need to be specified only if
461 non-innodb data or .frm files need to be backed up.
462 It is also required if logging of backup progress details into history
463 table is desired. To copy non-innodb data, the connection is used to
464 temporarily lock all tables until copying is completed.
465 The --no-locking option can be used to disable locking
466 even if the connection exists for the purpose of progress logging.
467
468 The SERVER-REPOSITORY-OPTIONS describes server repository.
469 It is useful during backup and restore operations.
470 For backup operations, the server repository parameters will be
471 obtained using the connection to mysqld server, if possible.
472 The parameters obtained through connection will override other sources.
473
474 The BACKUP-REPOSITORY-OPTIONS describes destination backup repository.
475 It is useful during backup operation.
476 For restore (copy-back) operation, the pre-existing
477 backup-dir/backup-my.cnf file describes the backup contents and
478 overrides any other relevant options specified even on command line.
479
480
481Default options are read from the following files in the given order:
482/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
483The following groups are read: mysqlbackup client
484The following options may be given as the first argument:
485--print-defaults Print the program argument list and exit.
486--no-defaults Don't read default options from any option file.
487--defaults-file=# Only read default options from the given file #.
488--defaults-extra-file=# Read this file after the global files are read.
489
490Variables (--variable-name=value)
491and boolean options {FALSE|TRUE} Value (after reading options)
492--------------------------------- -----------------------------
493debug (No default value)
494verbose FALSE
495force FALSE
496compress FALSE
497compress-level 0
498uncompress FALSE
499incremental FALSE
500start-lsn (No default value)
501only-known-file-types FALSE
502sleep (No default value)
503exec-when-locked (No default value)
504include (No default value)
505databases (No default value)
506databases-list-file (No default value)
507slave_info FALSE
508with-timestamp FALSE
509limit-memory (No default value)
510only-innodb FALSE
511no-history-logging FALSE
512suspend-at-end FALSE
513datadir (No default value)
514innodb_data_home_dir (No default value)
515innodb_data_file_path (No default value)
516innodb_log_group_home_dir (No default value)
517innodb_log_files_in_group (No default value)
518innodb_log_file_size (No default value)
519backup_dir (No default value)
520incremental_backup_dir (No default value)
521backup_innodb_data_home_dir (No default value)
522backup_innodb_data_file_path (No default value)
523backup_innodb_log_group_home_dir (No default value)
524backup_innodb_log_files_in_group (No default value)
525backup_innodb_log_file_size (No default value)
526no-connection FALSE
527connect-if-online FALSE
528no-locking FALSE
529backup-image (No default value)
530comments (No default value)
531comments-file (No default value)
532src-entry (No default value)
533dst-entry (No default value)
534sbt-database-name (No default value)
535sbt-lib-path (No default value)
536user root
537password EcOjacyim3
538port 0
539socket (No default value)
540host (No default value)
541connect_timeout 0
542character-sets-dir (No default value)
543default-character-set (No default value)
544secure-auth FALSE
545disable-manifest FALSE