The experience of my own people
First of all, a brief introduction of this novice card entry backstage, this backstage is provided to the product personnel to use. Can be to a certain game of a specific section of the batch input card information to facilitate the player to obtain. Background set a one-time maximum input amount of 500.
Read the log first, the content of the error and log the same:
ERROR:SQLSTATE[HY000]: General error:2006 MySQL Server has gone away
This error message is well described as a result of a database timeout. Before listening to predecessors said, should be wait_timeout environment variable set up a problem. But after viewing, found Wait_timeout set high Ah, for 28800, should not be a problem ah. No solution.
When the head comes back, tell. The head laughs but the language, lets me only look, does not say the words.
The code is as follows |
Copy Code |
Show global variables;
Set global wait_timeout = 120; |
summed up the solution, but a lot of MySQL server has gone away is not related to this problem, there are and max_allowed_packet about the
SQLyog the error when importing the database
Error Code:2006–mysql server has gone away
Searched, said to be Max_allowed_packet (one of the parameters of MySQL) Set the value is not big enough.
I'll just change it, hehe.
In Windows:
In the MySQL Server installation directory,
In My.ini file, add the following line under [mysqld] into SERVER section.
Max_allowed_packet = 16M
In Linux:
Copy the my-xxx.cnf file From/usr/share/mysql to/etc as My.cnf
XXX can be small, medium, large, huge ... depending on the requirement.
The code is as follows |
Copy Code |
$ cp/usr/share/mysql/my-xxx.cnf/etc/my.cnf In the my.cnf file, change the default Max_allowed_packet = 1M To Max_allowed_packet = 16M |
Save the file and restart MySQL server.
Error Code:2006–mysql server has gone away errors when importing. sql files today, the imported SQL file is larger than the system default Max_allowed_packet value, and many modifications to the configuration file are found However, the My.cfg file is not found and the other files are not used, so the SQL statement is used directly to modify:
The code is as follows |
Copy Code |
SET GLOBAL max_allowed_packet=67108864; |
On it, not max_allowed_packet the bigger the better oh, we can according to their own situation to set.