Currently, MySQL does not support Data Copying across servers, that is, it cannot use statements similar to insert into db1.xx select * From db2.xx.
You can think of two methods:
(1) import the required data to the SQL file through mysqdump, and then use MySQL-uxxx-p-hxxx. xxx. x. xxx DB2 <xx. SQL to the database.
(2) write a script by yourself. First, select the data from the source table cursor and put it into the cache, and then insert the data into the target table by pointing to the cursor of the target table; however, this method is generally used in scenarios with small data volumes.
In addition, if the data volume is large, I think the myi, MYD, and frm files can be directly SCP to the corresponding directory of MySQL on the target server. After MySQL automatically checks and repairs the data, you can directly use the insert. Select method to import the data.