Original: MySQL import SQL file is too large or connection timeout solution
In the early days of business travel in the field of development, the import database is always a problem. Finally found a magic SQL statement to the implementation, as long as the import error will be the following statement execution on it. 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; Effective for subsequent 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 connection timed out solution