Getting a Mysql Database error in debug.log, Server crashes

[14-Sep-2022 16:28:32 UTC] PHP Warning: mysqli_real_connect(): Error while reading greeting packet. PID=501493 in /var/www/yolosand/public/wp-includes/wp-db.php on line 1753 [14-Sep-2022 16:28:32 UTC] PHP Warning: mysqli_real_connect(): (HY000/2006): MySQL server has gone away in /var/www/yolosand/public/wp-includes/wp-db.php on line 1753 [14-Sep-2022 16:28:32 UTC] PHP Warning: mysqli_set_charset(): Error executing query in /var/www/yolosand/public/wp-includes/wp-db.php on line 884 [14-Sep-2022 16:28:36 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /var/www/yolosand/public/wp-includes/wp-db.php on line 1753

Everyday the server will go down for 3-5min and then be back up. I have tried adding a swap space but that didnt solve the issue. I use the server as a multisite and have 10 websites on there.

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It sounds like your MySQL server might be crashing due to resource limitations.

I could suggest a couple of things:

  • Follow the steps here on how to tweak your MySQL instance for better performance:

  • Add a bit of extra RAM to the server

  • Add a swap file in case that you don’t have one already:



Site Moderator
Site Moderator badge
September 15, 2022

Hello @sandyturquoiseanchor

Can you confirm if MySQL goes down and then you need to manually restart it or does the issue auto-resolves?

You can examine the logs and check if the droplet is running out of memory due to the MySQL activity.