I keep getting a "Warning: mysql errors" message

For about a week now my website displays these errors when somebody navigates to it:

Warning: mysql_query(): MySQL server has gone away in /storage/h2/613/637613/public_html/wp-includes/wp-db.php on line 1879
Warning: mysql_query(): Error reading result set’s header in /storage/h2/613/637613/public_html/wp-includes/wp-db.php on line 1879
Warning: mysql_query(): MySQL server has gone away in /storage/h2/613/637613/public_html/wp-includes/wp-db.php on line 840
Warning: mysql_query(): Error reading result set’s header in /storage/h2/613/637613/public_html/wp-includes/wp-db.php on line 840

I was told by someone yesterday that this means there is something wrong with my code, but I haven’t changed my code recently. Any help is appreciated.

What is your domain name??

Nelainephotography.com

Can you change your php version to 5.4 or any other suitable for your script from “settings-- general – php version”??
Then try again.

Can you check your wp-config.php contains the correct values for your database.

Grab your username, databasename and password from 000webhost.com > Manage Database

Your host is localhost.

Where do I find my wp-config.php?

I tried changing my php version from 7.1 to 5.4, but it didn’t fix the errors

In public_html on your hosting?

So like i would go into my database? Sorry, I’m not following; I have only ever used the WordPress editor to make changes to my site.

Site appears to be functioning fine?

Has the issue resolved?

If not open public_html in the file manager, open wp-config.php

Now look for all the database values such as

host:
username:
databasename:
password:

Make sure these values match that via 000webhost.com > Manage Database > and the database details listed.

If your site continues to struggle on freehosting due to the WordPress configuration I’d recommend premium for the issues to be resolved.

It does seem to be working now. I tried clearing my cache and that did the trick. It’s strange because I tried doing the same thing last week when it started, but it didn’t work, and others were experiencing the same issues. Glad it’s back up though!

1 Like