Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save asamofal/5381aa019594204d98436def2f7d12bc to your computer and use it in GitHub Desktop.
Save asamofal/5381aa019594204d98436def2f7d12bc to your computer and use it in GitHub Desktop.
MySQL 8.0.17 Clone Plugin: How to Create a Slave from Scratch
# https://www.percona.com/blog/2019/08/01/mysql-8-0-17-clone-plugin-how-to-create-a-slave-from-scratch/
# install clone plugin (on both instances)
INSTALL PLUGIN clone SONAME 'mysql_clone.so';
# check if plugin is active (on both instances)
SELECT
PLUGIN_NAME,
PLUGIN_STATUS
FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME = 'clone';
# create the user for this routine
CREATE USER backup@'%' IDENTIFIED BY 'passowrd';
GRANT BACKUP_ADMIN ON *.* TO backup@'%';
# check the donor list
SHOW VARIABLES LIKE 'clone_valid_donor_list';
# if empty let's add a new one
SET GLOBAL clone_valid_donor_list = 'host.docker.internal:3307';
# adjust the verbosity to a higher level
SET GLOBAL log_error_verbosity = 3;
# start the cloning process
CLONE INSTANCE FROM host.docker.internal:3307 IDENTIFIED BY 'password';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment