General error:2006 MySQL server have gone away released: Source: Added on: 2014-10-02 23:00:56 View:146 Comments: 0
If we look at MySQL prompt MySQL server has gone away is due to a variety of reasons cause MySQL when the machine, resulting in MySQL server has gone away for many reasons, let me summarize.
My own person's experience: the first simple introduction of this novice card entry backstage, this backstage is provided to the product personnel to use, you can go to a particular game of a specific partition to enter the new card information, convenient for players to obtain, background settings of a one-time maximum input amount of 500.
Read the log first, the error content and the same log:
ERROR:SQLSTATE[HY000]: General error:2006 MySQL server have gone away
This error message is a good description of the database time-out, before listening to predecessors said, should be wait_timeout environment variable settings have a problem, but after viewing, found that Wait_timeout set the good high Ah, for 28800, should not be a problem ah, no solution.
Come back, tell, head smile without words, let me only see, don't say, code as follows:
- Show global variables;--phpfensi.com
- Set Global wait_timeout = +;
Summary resolved, but a lot of MySQL server has gone away is not related to this issue, all have and max_allowed_packet about, import database when SQLyog error.
Error Code:2006–mysql server has gone away
Search, said to be a max_allowed_packet,mysql parameter, set the value is not big enough, then I changed on the line hey.
- In Windows:
- In the MySQL Server installation directory,
- In My.ini file, add the following line under [Mysqld] on 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 .
- --code as follows
- $ 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.
The error code:2006–mysql server has gone away errors when importing the. sql file today is that the imported SQL file is larger than the default Max_allowed_packet value of the system, and a lot of changes have been made to the configuration file. But did not find the My.cfg file, modify other files regardless of use, so directly using SQL statements to modify, the code is as follows:
SET GLOBAL max_allowed_packet=67108864;
Can be, not max_allowed_packet bigger the better, we can according to their own situation to set.
MySQL server has gone away