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 !!