Title: Errors in wp-db.php
Last modified: March 10, 2020

---

# Errors in wp-db.php

 *  Resolved [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/)
 * Constantly getting this error…
 *     ```
       PHP Warning:  mysqli_query(): Error reading result set's header in /home/*********/public_html/wp-includes/wp-db.php on line 2030
       PHP Warning:  mysqli_query(): MySQL server has gone away in /home/*********/public_html/wp-includes/wp-db.php on line 2030
       ```
   
 * …suggestions to solve?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Jazz](https://wordpress.org/support/users/jraborar/)
 * (@jraborar)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12527145)
 * [@neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * Two most common reasons (and fixes) for the MySQL server has gone away (error
   2006) are:
 * Server timed out and closed the connection. How to fix:
 * check that wait_timeout variable in your mysqld’s my.cnf configuration file is
   large enough. On Debian: sudo nano
    /etc/mysql/my.cnf, set wait_timeout = 600
   seconds (you can tweak/decrease this value when error 2006 is gone), then sudo/
   etc/init.d/mysql restart. I didn’t check, but the default value for wait_timeout
   might be around 28800 seconds (8 hours).
 * Server dropped an incorrect or too large packet. If mysqld gets a packet that
   is too large or incorrect, it assumes that something has gone wrong with the 
   client and closes the connection. You can increase the maximal packet size limit
   by increasing the value of max_allowed_packet in my.cnf file. On Debian: sudo
   nano
    /etc/mysql/my.cnf, set max_allowed_packet = 64M (you can tweak/decrease
   this value when error 2006 is gone), then sudo /etc/init.d/mysql restart.
 * if you can’t run commands then you can simply edit these files. (my.cnf or my.
   ini) with proper values.
 *  Thread Starter [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12527217)
 * Thanks for the swift reply.
    I have root access – Hosted VPS, Centos 7.7, cPanel
   ver.86.0.12 – so I will give these a try, but are the directory paths and cmds
   different on Centos than Debian?
 *  Thread Starter [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12527384)
 * [@jraborar](https://wordpress.org/support/users/jraborar/)
    I increased the max_allowed_packet
   to 1073741824. I will wait and see if this solves the issue. Thanks again. 🙂
 *  Moderator [Yui](https://wordpress.org/support/users/fierevere/)
 * (@fierevere)
 * 永子
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12527396)
 * You can find some more info in mysql error log, why server has gone away,
    generally
   this error happens when here is something really weird with the server. Like:
   memory exhausted, max_allowed_packet is too small, corrupted tables and/or filesystem,
   more bad things.
 * _By default in CentOS, your error log must be in /var/lib/mysql/hostname. err(
   replace hostname by the real hostname of your server)_
 * Please check bottom of error log file
 * > I increased the max_allowed_packet to 1073741824.
 * enormous values are not recommended.
    For typical WP+WooCommerce installs 16M
   is enough, 32M-64M is near the maximum expectation.
    -  This reply was modified 6 years, 2 months ago by [Yui](https://wordpress.org/support/users/fierevere/).
 *  Thread Starter [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12532014)
 * [@fierevere](https://wordpress.org/support/users/fierevere/)
    Thanks for the 
   advice.
 * Original max_allowed_packet was 268435456 before I changed it to 1073741824.
   
   I have now changed max_allowed_packet to 67108864. Will keep an eye on error 
   log and advise.
 *  Thread Starter [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * (@neotechnomad)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12542358)
 * Decreasing the max_allowed_packet to 67108864 seems to have fixed it.
    Thanks
   for all your assistance. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Errors in wp-db.php’ is closed to new replies.

## Tags

 * [errors](https://wordpress.org/support/topic-tag/errors/)
 * [wp-db.php](https://wordpress.org/support/topic-tag/wp-db-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [neotechnomad](https://wordpress.org/support/users/neotechnomad/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/errors-in-wp-db-php/#post-12542358)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
