I'm running a server at my office to process some files and report the results to a remote MySQL server.
The files processing takes some time and the process dies halfway through with the following error:
2006, MySQL server has gone away
I've heard about the MySQL setting, wait_timeout, but do I need to change that on the server at my office or the remote MySQL server?
It may be easier to check if the connection and re-establish it if needed.
See PHP:mysqli_ping for info on that.
If you are using the 64Bit WAMPSERVER, please search for multiple occurrences of max_allowed_packet because WAMP uses the value set under [wampmysqld64] and not the value set under [mysqldump], which for me was the issue, I was updating the wrong one. Set this to something like max_allowed_packet = 64M.
Hopefully this helps other Wampserver-users out there.
For users using XAMPP, there are 2 max_allowed_packet parameters in C:\xampp\mysql\bin\my.ini.
In MAMP (non-pro version) I added
to
...\MAMP\bin\startMysql.sh
Credits and more details here
This error is occur due to expire of wait_timeout .
Just go to mysql server check its wait_timeout :
http://sggoyal.blogspot.in/2015/01/2006-mysql-server-has-gone-away.html
On windows those guys using xampp should use this path xampp/mysql/bin/my.ini and change max_allowed_packet(under section[mysqld])to your choice size. e.g
Again on php.ini(xampp/php/php.ini) change upload_max_filesize the choice size. e.g
Gave me a headache for sometime till i discovered this. Hope it helps.