Load the Clone plugin¶
You cannot use the --plugin-load-add
option to load the clone plugin during an upgrade from a previous MySQL version. Attempting to do so will raise an error. Upgrade the server first, then start it with plugin-load-add=mysql_clone.so
.
Load the plugin¶
Locate the Plugin Library File: Ensure the plugin library file (mysql_clone.so
) is in the MySQL plugin directory (plugin_dir
system variable). Set plugin_dir
at server startup if necessary.
Load the Plugin at Server Startup: Use the --plugin-load-add
option to name the library file. Add the following lines to your my.cnf
file:
[mysqld]
plugin-load-add=mysql_clone.so
Load the Plugin at Runtime: Alternatively, you can load the plugin at runtime with the following SQL statement:
INSTALL PLUGIN clone SONAME 'mysql_clone.so';
This command loads the plugin and registers it in the mysql.plugins
table, ensuring it loads automatically at subsequent server startups without --plugin-load-add
.
Verify Plugin installation¶
Check the INFORMATION_SCHEMA.PLUGINS
table or use the SHOW PLUGINS
statement to verify the plugin installation:
SELECT PLUGIN_NAME, PLUGIN_STATUS
FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME = 'clone';
Control plugin activation state¶
If the plugin is registered with INSTALL PLUGIN
or loaded with --plugin-load-add
, use the --clone
option at server startup to control its activation state. To load the plugin at startup and prevent it from being removed at runtime, add these options:
[mysqld]
plugin-load-add=mysql_clone.so
clone=FORCE_PLUS_PERMANENT
To prevent the server from running without the clone plugin, use --clone
with FORCE
or FORCE_PLUS_PERMANENT
. These options ensure the server startup fails if the plugin does not initialize successfully.