Lost connection to MySQL


Hi everyone,

I have a Wordpress site running on Dreamhost servers.

Initially, I had both the MySQL and WordPress running on a Shared hosting but processes kept getting killed and I was advised to switch to a VPS.

So that’s what I did for both the WordPress and MySQL. I noticed that even though it was a new site with literally no visitors, the site’s total memory usage (Cached + Actual) can reach 500-600mb spikes. However, the CPU load is usually below 0.5.

I would like to know if its normal to have a WordPress site run into such high memory usage and if its possible to reduce them. Does plugins eat up memory resources that can potentially hang a site? I have asked the support guys what’s the amount of resources available in a Shared Hosting environment but they have not been forthcoming with the information.

Secondly, as I noticed the MySQL usage being low and stable during the free trial period on the VPS, I decided to switch it back to Shared Hosting.

I updated my WordPress from 3.4 to 3.4.1 thereafter says " Invalid DB User: could not find any users for your database xxxx". Even though I was able to access my site and log in to the admin page. The database xxxx was an old database which my WordPress site was not using and I have it deleted before this. It was also not in my wp-config.php.

Now a few days later, when I tried logging in to WordPress, I get “Error establishing a database connection”. And when I tried logging into the database via phpMyAdmin, I get an error “#2013 - Lost connection to MySQL server at ‘reading initial communication packet’, system error: 113”.

I am able to ping the MySQL database though.

Anyone who can help me with this, thank you!


Hey there,

The exact same thing happened me.

I think I got hacked. Check your DB users. Change all your DB passwords as well as all your other passwords associated with the account.

Contact support and get them to run an analysis. They will let you know if any files have been compromised.

It’s a pain, but happens.

Good luck.