In the early days of business travel in the field of development, the import database is always a problem. Finally found a wonderful SQL statement to the implementation, just to import an error, such as the following statement to run. So far.
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 above statement:
–max_allowed_packet=xxx the maximum size of the buffer between client/server communication;
–net_buffer_length=xxx TCP/IP and socket communication buffer size, creating a line of length up to Net_buffer_length
Interactive_timeout = 10; Valid for interactive links;
Wait_timeout is valid for the current interactive link;
=============================================
The above statement mainly resolves: the connection timed out, the imported SQL file is too large.
MySQL import SQL file is too large or the connection timeout resolved method