Rechercher dans le manuel MySQL
5.6.7.2 Cloning Data Locally
The clone plugin supports the following syntax for cloning data locally; that is, cloning data from the local MySQL data directory to a local directory on the same server or node where the MySQL server instance runs:
To use CLONE
syntax, the clone plugin must be
installed. For installation instructions, see
Section 5.6.7.1, “Installing the Clone Plugin”.
The BACKUP_ADMIN
privilege is
required to execute CLONE LOCAL DATA
DIRECTORY
statements.
where
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 clone_user
BACKUP_ADMIN
privilege on *.*.
The following example demonstrates cloning data locally:
where /path/to/clone_dir
is the full
path of the local directory that data is cloned to. An absolute
path is required, and the directory must not exist. The MySQL
server must have the necessary write access to create the
directory.
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):
File '/path/to/tablespace_name.ibd
'
already exists. Cloning a tablespace with the same
path as the source tablespace would cause a conflict and is
therefore prohibited.
All other user-created InnoDB
tables and
tablespaces, the InnoDB
system tablespace,
redo logs, and undo tablespaces are cloned to the specified
directory.
If desired, you can start the MySQL server on the cloned directory after the cloning operation is complete.
shell> mysqld_safe --datadir=clone_dir
where clone_dir
is the directory that
data was cloned to.
For information about monitoring cloning operation status and progress, see Section 5.6.7.9, “Monitoring Cloning Operations”.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-clone-plugin-local.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.