Wordpress database keeps losing connecting since moving to London Host

Posted July 21, 2014 6.2k views

Hi all,

Since taking a snapshot and moving to the new London host via the guide my website keeps losing connection to the wordpress database. A quick restart of the server fixes this,

Any ideas? I’ve had to move it back to Amsterdam for now.


1 comment
  • did you find what was the problem?
    i’m having the exact same issue in lon1.
    it says:“cannot connect to the database” - and after reboot its fine again.
    my droplet is 10 days old, and just recently been indexed by search engines so i’m pretty sure it is not running out of memory.

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.

Submit an Answer
7 answers

how exactly it keeps losing connection?

I’m not sure.

It just comes up saying “Error connecting to database”

What size is the droplet? It sounds like you’re running out of memory which causes MySQL to crash.

Its the basic one with 512mb so maybe that could be it. I never noticed it crash on the same size on Amsterdam though which is still active and up and running.

Try adding swap to your droplet: How To Add Swap on Ubuntu 14.04.

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.
  • hi kamal. i have the same issue in lon1. i think it could be an attack (ddos).
    in the log file i see hundreds of:
    POST /xmlrpc.php HTTP/1.0" 200 578
    that comes from the same ip.
    do you have any idea whats going on? thanks..

Hi! I’m experiencing the exact same issue. But I have the 1gb server size. Any suggestions on a fix?

I’m having the same problem. I asked my son who is a server expert and he checked the apache logs and mysql logs and said “The problem seems like it is mysql consuming more and more memory over time and crashing, and there’s a couple options that might cause this. The most likely one is that there is a bad Wordpress plugin installed so plugins should be updated and if that doesn’t fix it then I should start searching on google for problems with the ones I am using.”