Solution for importing SQL files from mysql is too large or connection timeout
When I was on a business trip for development in the field some time ago, there was always a problem with importing databases. Finally, we found a magic SQL statement for implementation. If an import error occurs, we can execute the following statement. So far, it has been a trial.
Set global max_allowed_packet = 100 000 000; set global net_buffer_length = 100000; set global interactive_timeout = 28800 000; set global wait_timeout = 28800000
Explanation of the preceding statement:
-Max_allowed_packet = maximum size of the cache for communications between the XXX client/server;
-Net_buffer_length = XXX TCP/IP and socket communication buffer size, create line with length up to net_buffer_length
Interactive_timeout = 10; valid for subsequent interaction links;
Wait_timeout is valid for the current interactive link;
========================================================== =====
The preceding statement mainly solves the following problems: Connection timeout and the imported SQL file is too large.