The clone plugin supports the following syntax for cloning data locally; that is, cloning data from the local MySQL data directory to another directory on the same server or node where the MySQL server instance runs:
CLONE LOCAL DATA DIRECTORY [=] 'clone_dir';
mysql> GRANT BACKUP_ADMIN ON *.* TO 'clone_user';
is the MySQL user that will perform the cloning operation. The
user you select to perform the cloning operation can be any
MySQL user with the
privilege on *.*.
The following example demonstrates cloning data locally:
mysql> CLONE LOCAL DATA DIRECTORY = '/path/to/clone_dir';
/path/to/clone_dir is the full
path of the local directory that data is cloned to. An absolute
path is required, and the specified directory
clone_dir”) must not
exist, but the specified path must be an existent path. The
MySQL server must have the necessary write access to create the
A local cloning operation does not support cloning of
user-created tables or tablespaces that reside outside of the
data directory. Attempting to clone such tables or tablespaces
causes the following error: ERROR 1086 (HY000):
already exists. Cloning a tablespace with the same
path as the source tablespace would cause a conflict and is
All other user-created
InnoDB tables and
InnoDB system tablespace,
redo logs, and undo tablespaces are cloned to the specified
If desired, you can start the MySQL server on the cloned directory after the cloning operation is complete.
shell> mysqld_safe --datadir=clone_dir
clone_dir is the directory that
data was cloned to.
For information about monitoring cloning operation status and progress, see Section 220.127.116.11, “Monitoring Cloning Operations”.