13.6 Compression Options

For an overview on backup compression, see Section 4.3.4, “Making a Compressed Backup”.

  • --compress

    Create backup in compressed format. For a regular backup, among all the storage engines supported by MySQL, only data files of the InnoDB format are compressed, and they bear the .ibz extension after the compression. Similarly, for a single-image backup, only data files of the InnoDB format inside the backup image are compressed. The binary log and relay log files are compressed and saved with the .bz extension when being included in a compressed backup.

    Default: compression is disabled.

  • --compress-method=ALGORITHM

    Command-Line Format--compress-method=ALGORITHM
    Permitted ValuesTypeenumeration
    Valid Valueszlib

    Specifies the compression algorithm. The supported arguments for the option and the algorithms they represent are:

    • lz4: LZ4 r109. Out of the three algorithms that are supported, this is the most efficient one, typically taking the shortest backup and restore times with the lowest CPU cost. See lz4—Extremely Fast Compression algorithm for more details, including a comparison with other compression algorithms.

    • lzma: LZMA 9.20. Out of the three supported algorithms, this typically provides the highest compression ratio; but it is also far more expensive in terms of CPU cost than the other two options. Thus we do not recommend this for active systems, but only for off-hour or inactive databases, or where I/O rates are extremely low.

    • zlib: ZLIB v1.2.3. This is in between the other two supported algorithms in terms of both speed and compression ratio. ZLIB was the only compression algorithm available for MySQL Enterprise Backup versions prior to 3.10.

    Default: lz4. Explicitly specifying a value for the option through a configuration file or command line automatically enables the --compress option.

  • --compress-level=LEVEL

    Command-Line Format--compress-level=LEVEL
    Permitted ValuesTypenumeric
    Min Value0
    Max Value9

    Specifies the level of compression, ranging from 0 to 9: 0 disables compression; 1 is fastest compression, and 9 is highest (and slowest) compression. The option is only meaningful for compression using the ZLIB or LZMA algorithm; it is ignored when any other algorithms are selected by the --compress-method option.

    Default: 1 (lowest and fastest compression). Explicitly specifying a non-zero value through a configuration file or command line automatically enables the --compress option.

Download this Manual
PDF (US Ltr) - 1.1Mb
PDF (A4) - 1.1Mb
EPUB - 241.4Kb
HTML Download (TGZ) - 189.3Kb
HTML Download (Zip) - 218.6Kb
User Comments
Sign Up Login You must be logged in to post a comment.