Blog · WebJi® India

MySQL Server Has Gone Away

Quick answer: MySQL Server Has Gone Away from WebJi®, billed in INR with 18% GST on the invoice. Email support@webji.services is 24/7 in Hindi and English (average first reply under 60 minutes). Phone +91 141 4941811 is business hours only. The company has been in this business since 2005.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Festive Diwali scene with marigold garlands, gift boxes, diyas and a laptop with a shopping cart — mysql server has gone away

What 'Server Has Gone Away' Means

Error 2006 fires when the client's TCP connection to mysqld dies before an answer arrives — and three distinct causes wear the same error message. Fix them in this order:

  1. max_allowed_packet too low — a multi-row INSERT or LONGTEXT payload exceeds the ceiling; the server drops the connection. Raise it in my.cnf under [mysqld]: max_allowed_packet=256M, match it on the client side, and pass the same flag on the restore command.
  2. wait_timeout and idle drops — an idle connection outlives the server's patience and dies on the next query.
  3. Crashed MySQL or OOM — every connection dying simultaneously means the server itself fell over; check the error log.

On shared hosting without my.cnf access, split the dump or set the flag per invocation; the database workflow guide covers the panel side.

Cause 1: max_allowed_packet Too Low

MySQL's default max_allowed_packet is often 16MB or 64MB depending on version, while a single multi-row INSERT from a dump — or a LONGTEXT payload — can exceed it. The server refuses or drops the oversized packet and the client sees 'gone away'.

Festive Diwali scene with marigold garlands, gift boxes, diyas and a laptop with a shopping cart — mysql server has gone away

Fix it in my.cnf under [mysqld]: max_allowed_packet=256M, and match the client side under [mysql] or [client] with the same value, plus the same flag on the restore command itself (mysql --max_allowed_packet=256M ...). On shared hosting where you cannot edit my.cnf, split the dump or pipe it with the flag set per invocation. A 256M ceiling handles virtually all WordPress and CMS imports; raise it only for genuine blob-heavy workloads.

Cause 2: wait_timeout and Idle Drops

After a domain expires there is usually a grace window where renewal is still the normal fee and the name is still yours. Redemption comes next and the restore fee is much higher. Once the name drops, anyone can register it. Turn auto-renew on for names you cannot afford to lose, and keep the registrant email alive.

Fixing Large Imports (mysqldump flags)

How this plays out with wait_timeout: settings that look cosmetic usually decide page speed and uptime under real traffic. The defaults WebJi® ships are tuned for Indian network conditions, and support can review your setup on request.

Cause 3: Crashed MySQL or OOM (Host Side)

When every connection dies simultaneously, suspect the server, not the settings. Check systemctl status mysql and the error log (/var/log/mysql/error.log or /var/log/mysqld.log) for lines about InnoDB recovery or 'killed'.

The frequent culprit is the Linux OOM killer reclaiming memory from mysqld on a RAM-tight VPS — visible as 'Killed' in the log and an oom-kill event in dmesg. Restart safely: systemctl restart mysql, then stop the bleeding by lowering innodb_buffer_pool_size to roughly 50–60% of RAM, removing competing services, or upgrading the instance. If crashes repeat on a hosting plan you do not control, that is the host's problem to fix — collect timestamps and the error log and raise a ticket.

Frequently Asked Questions

How do I fix MySQL 'server has gone away'?

MySQL's default max_allowed_packet is often 16MB or 64MB depending on version, while a single multi-row INSERT from a dump — or a LONGTEXT payload — can exceed it. The server refuses or drops the oversized packet and the client sees 'gone away'.

What causes MySQL error 2006?

Error 2006 fires when the client's TCP connection to mysqld dies before an answer arrives — and three distinct causes wear the same error message. Fix them in this order:

What should max_allowed_packet be set to?

Fix it in my.cnf under [mysqld]: max_allowed_packet=256M, and match the client side under [mysql] or [client] with the same value, plus the same flag on the restore command itself (mysql --max_allowed_packet=256M ...). On shared hosting where you cannot edit my.cnf, split the dump or pipe it with the flag set per invocation.

Why does the error happen during big database imports?

MySQL Server Has Gone Away. Email support@webji.services is 24/7 in Hindi and English, average first reply under 60 minutes. Phone +91 141 4941811 is business hours. If the question is about your own account, open a ticket at https://billing.webji.in/submitticket.php?step=2&deptid=10.

How do I restart MySQL safely?

The frequent culprit is the Linux OOM killer reclaiming memory from mysqld on a RAM-tight VPS — visible as 'Killed' in the log and an oom-kill event in dmesg. Restart safely: systemctl restart mysql, then stop the bleeding by lowering innodb_buffer_pool_size to roughly 50–60% of RAM, removing competing services, or upgrading the instance.

Is this a hosting problem or a code problem?

For “Is this a hosting problem or a code problem”: The frequent culprit is the Linux OOM killer reclaiming memory from mysqld on a RAM-tight VPS — visible as 'Killed' in the log and an oom-kill event in dmesg. Restart safely: systemctl restart mysql, then stop the bleeding by lowering innodb_buffer_pool_size to roughly 50–60% of RAM, removing competing services, or upgrading the instance.

Is WebJi® an Indian company?

Yes. WebJi® is headquartered in Jaipur, Rajasthan and has operated since 2005. Billing, support and governance all run from India.

Do you provide GST invoices?

Every purchase and renewal gets a GST invoice with our GSTIN, and hosting prices are quoted exclusive of 18% GST. Claim input credit as applicable.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →