[MySQL] cross-server data copying

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.