0

I'm a server at my office to process some files and report the results to a remote MySQL server.

The files processing takes sometime and the process dies halfway through with the error: 2006, mysql server has gone away

Ive 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?

2 Answers 2

0

do I need to change that on the server at my office or the remote MySQL server?

If it die while processsing, this error is thrown by the MySQL server at your office. Otherwise, dying after the process completed means that the remote MySQL server throw this error.

In your case, I suspect that you're sending a too large query to the remote MySQL server. You can increase the query limit by setting max_allowed_packet variable.

Take a look at the document for the common causes of this error.

0

I was getting this same error on my DigitalOcean Ubuntu server.

I tried changing the max_allowed_packet and the wait_timeout settings but neither of them fixed it.

It turns out that my server was out of RAM. I added a 1GB swap file and that fixed my problem.

Check your memory with free -h to see if that's what's causing it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .