Description:
When I used copy, I encountered an error. My host has different IP, different MAC address, uuid and server_id.
[root@mydb ~]# mysqlsh --js
MySQL Shell 8.4.1
Copyright (c) 2016, 2024, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Type '\help' or '\?' for help; '\quit' to exit.
Creating a Classic session to 'root@localhost'
Fetching schema names for auto-completion... Press ^C to stop.
Your MySQL connection id is 11
Server version: 8.4.1 MySQL Community Server - GPL
No default schema selected; type \use <schema> to set one.
MySQL localhost JS > util.copySchemas(['world'], 'root@192.168.5.140:3306',{schema: "mySakilaSchema"})
Util.copySchemas: The target instance is the same as the source instance (ArgumentError)
MySQL localhost JS >
MySQL localhost JS >
MySQL localhost JS >
MySQL localhost JS > \system ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:26:56:4c brd ff:ff:ff:ff:ff:ff
altname enp3s0
inet 192.168.5.130/24 brd 192.168.5.255 scope global noprefixroute ens160
valid_lft forever preferred_lft forever
MySQL localhost JS > util.copyTables('world', ['city'], 'root@192.168.5.140:3306',{schema: "db01",threads:"8",deferTableIndexes:"all",skipBinlog:"true"})
Util.copyTables: The target instance is the same as the source instance (ArgumentError)
MySQL localhost JS >
How to repeat:
host 1 ip :192.168.5.130
host 1 ip :192.168.5.140
on host 1
MySQL localhost JS > util.copySchemas(['world'], 'root@192.168.5.140:3306',{schema: "mySakilaSchema"})