Documentation Home
MySQL 9.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.2Mb
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


7.6.6.1 Installing the Clone Plugin

This section describes how to install and configure the clone plugin. For remote cloning operations, the clone plugin must be installed on the donor and recipient MySQL server instances.

For general information about installing or uninstalling plugins, seeSection 7.6.1, “Installing and Uninstalling Plugins”.

To be usable by the server, the plugin library file must be located in the MySQL plugin directory (the directory named by theplugin_dir system variable). If necessary, set the value ofplugin_dir at server startup to tell the server the plugin directory location.

The plugin library file base name ismysql_clone.so. The file name suffix differs by platform (for example,.so for Unix and Unix-like systems,.dll for Windows).

To load the plugin at server startup, use the--plugin-load-add option to name the library file that contains it. With this plugin-loading method, the option must be given each time the server starts. For example, put these lines in yourmy.cnf file, adjusting the plugin library file name extension for your platform as necessary. (The plugin library file name extension depends on your platform. Common suffixes are.so for Unix and Unix-like systems,.dll for Windows.)

[mysqld]plugin-load-add=mysql_clone.so

After modifyingmy.cnf, restart the server to cause the new settings to take effect.

Note

The--plugin-load-add option cannot be used to load the clone plugin when restarting the server during an upgrade from a previous MySQL version. In such cases, attempting to restart the server withplugin-load-add=mysql_clone.so raises the error[ERROR] [MY-013238] [Server] Error installing plugin 'clone': Cannot install during upgrade. To keep this from happening, upgrade the server before attempting to start the server withplugin-load-add=mysql_clone.so.

Alternatively, to load the plugin at runtime, use this statement, adjusting the.so suffix for your platform as necessary:

INSTALL PLUGIN clone SONAME 'mysql_clone.so';

INSTALL PLUGIN loads the plugin, and also registers it in themysql.plugins system table to cause the plugin to be loaded for each subsequent normal server startup without the need for--plugin-load-add.

To verify plugin installation, examine the Information SchemaPLUGINS table or use theSHOW PLUGINS statement (seeSection 7.6.2, “Obtaining Server Plugin Information”). For example:

mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS       FROM INFORMATION_SCHEMA.PLUGINS       WHERE PLUGIN_NAME = 'clone';+------------------------+---------------+| PLUGIN_NAME            | PLUGIN_STATUS |+------------------------+---------------+| clone                  | ACTIVE        |+------------------------+---------------+

If the plugin fails to initialize, check the server error log for clone or plugin-related diagnostic messages.

If the plugin has been previously registered withINSTALL PLUGIN or is loaded with--plugin-load-add, you can use the--clone option at server startup to control the plugin activation state. For example, to load the plugin at startup and prevent it from being removed at runtime, use these options:

[mysqld]plugin-load-add=mysql_clone.soclone=FORCE_PLUS_PERMANENT

If you want to prevent the server from running without the clone plugin, use--clone with a value ofFORCE orFORCE_PLUS_PERMANENT to force server startup to fail if the plugin does not initialize successfully.

For more information about plugin activation states, seeControlling Plugin Activation State.