The fastest migration of mysql Data Tables. The storage engine of mysql is myisam.
Requirements:
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 !!