Report this

What is the reason for this report?

Wordpress: Error Establishing a database connection - Vesta CP - Works For 30 Seconds After Reboot

Posted on November 2, 2015
Zac1

By Zac1

Hello, I have several wordpress sites that have been working great on Digital Ocean up until today.

Now, all sites hosted on Digital Ocean are running into “Error Establishing a Database Connection”. (Similar sites I have not using Digital Ocean are just fine.)

When I reboot my droplet, I can connect and do anything I want on the sites for around 30 seconds - and then the database error reappears.

I am using Vesta CP (Vesta Control Panel). At the beginning of this problem I double-checked the username/password etc. for the databases that would also be located in the wp-config.php file. While the sites are down, it also shows “error connecting to localhost”.

Vesta CP also works for around thirty seconds after a quick reboot.

I created a swap file as shown here.

https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

But the problem still persists. Any ideas?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.