The MySQL client RPM
includes the binary mysqldump
, which produces SQL
statements from a MySQL database. In this recipe, we will explore the usage of this tool with MySQL Clusters.
Taking a backup with mysqldump
for MySQL Cluster (NDB
) tables is identical to other table engines and has all of the same disadvantages—most importantly that it requires significant locking to take a consistent backup. However, it is simple, easy to verify, and trivial to restore from and also provides a way to restore the backup from a MySQL Cluster into a standalone server (for example, by using InnoDB) in the case that a cluster is not available for recovery.
To run mysqldump
in the simplest way possible is to execute the following command:
mysqldump [options] db_name [tables]
It is often desirable to backup more than one or all databases. In that case, mysqldump
must run with the --all-databases
option. It is also often desirable to compress backups on-the...