# MYSQL 8.0 远程 clone

MYSQL 8.0 远程 clone

  • 各个节点加载插件
INSTALL PLUGIN clone SONAME 'mysql_clone.so';
或
[mysqld]
plugin-load-add=mysql_clone.so
clone=FORCE_PLUS_PERMANENT
  • 查看各加载clone状态
SELECT PLUGIN_NAME, PLUGIN_STATUS
FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME LIKE 'clone';
  • 创建远程clone用户
1.捐赠者(source)授权
create user test_s@'%' identified by '123';
grant backup_admin on *.* to test_s@'%';

2. 接受者(target)授权
create user test_t@'%' identified by '123';
grant clone_admin on *.* to test_t@'%';
  • 远程clone( 接收者 )
开始克隆 -->
管理用户:
mysql> SET GLOBAL clone_valid_donor_list='10.0.0.51:3306';

新窗口使用test_t用户重新连接数据库:
mysql -utest_t -p123 -h10.0.0.52  -P3306
mysql> CLONE INSTANCE FROM test_s@'10.0.0.51':3306 IDENTIFIED BY '123';
posted @ 2020-12-28 17:55  HSping  阅读(88)  评论(0编辑  收藏  举报