MySQL export fast, import a particularly slow solution:
Add two parameters to import: Max_allowed_packet; Net_buffer_length
--max_allowed_packet the maximum size of the buffer between client/server communication;
--net_buffer_length TCP/IP and socket communication buffer sizes, creating lengths up to Net_buffer_length lines.
Note: max_allowed_packet; Net_buffer_length These two parameters can not be larger than the target data size configuration, or will be an error.
1. View the target library's parameter values as follows:
Mysql> Show variables like ' Max_allowed_packet ';
+--------------------+---------+
| variable_name | Value |
+--------------------+---------+
| Max_allowed_packet | 4194304 |
+--------------------+---------+
1 row in Set (0.01 sec)
Mysql> Show variables like ' net_buffer_length ';
+-------------------+-------+
| variable_name | Value |
+-------------------+-------+
| Net_buffer_length | 16384 |
+-------------------+-------+
1 row in Set (0.00 sec)
2. Add parameters when importing:
Mysqldump-uroot-p 123456-e--max_allowed_packet=4194304--net_buffer_length=16384 > Test.sql
MySQL export data very quickly, import very slowly