The fastest migration of mysql data tables. the storage engine of mysql is myisam_MySQL.

Source: Internet
Author: User
Link to this article: http: www2ctocomuploadfileCollfiles2014112420141124090905277 requirement: there is a project branch during the development of the product. the database needs to copy data, but the table has a large amount of data. the traditional insertinto:

During product development, there is a project branch, and the database needs to be copied with data, but the table data is large. the traditional insert .... select *... very slow !!

Process:

1. enter the file directory of mysql on linux

You can find the mysql data file address in/etc/my. cnf.

[Root @ idata-slave3 etc] # cat/etc/my. cnf [mysqld] datadir =/var/lib/mysqlsocket =/var/lib/mysql. sockuser = mysql # Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links = 0 [mysqld_safe] log-error =/var/log/mysqld. logpid-file =/var/run/mysqld. piddefault-character-set = utf8 [client] password = 123qwe

2. view the Database Directory

Database list:

Our goal is to copy data from test to test1:

Test directory structure:

Table information:

The test1 directory and table are empty:

3. copy an object

4. modify permissions

5. query

Done !!

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.