Solution for importing SQL files from MySQL is too large or connection timeout
Some time ago, when I was on a business trip for development at the site, there was always a problem importing MySQL 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.
-------------------------------------- Split line --------------------------------------
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: