Commonly used parameters

  • -a /–all-databases Backs up all databases

  • -b /–databases Backs up multiple databases

    Mysqldump -uxx-pxxx -b mysqldump -uxx-pxxx -b mysqldump -uxx-pxxx -b mysqldump -uxx-pxxx -b mysqldump -uxx-pxxx -bCopy the code
  • Single-transaction is only used by InnoDB engine to ensure consistency when backing up data

  • –master-data=1/2

    This option writes the location and filename of the binary log to the output. This option requires RELOAD permission and binary logging must be enabled. If this option value is equal to 1, the location and file name are written to the dump output in the form of the CHANGE MASTER statement. If you use this SQL to dump the MASTER server to set the slave server, the slave server starts from the correct location of the binary log on the MASTER server. If the option value is 2, the CHANGE MASTER statement is written as an SQL comment.

  • –dump-slave=1/2 This parameter is used to back up data on the slave database and build a slave database online

  • –no-data/-d Backs up only table structures, not data

  • –complete-insert/-c Use complete insert statements to improve insert efficiency

  • -t exports only insert statements

  • –where=/w

  • –default-character-set Sets the character set

  • -f /–flush-logs Flushes binary logs