Report this

What is the reason for this report?

One-Click Install Wordpress Droplet - Error establishing database connection returns

Posted on November 1, 2019

Hey there, I have been trying to use the One-Click Install Wordpress Droplet for many many years now and every time after a certain while the droplet starts having the same problem. Error establishing a database connection. The MySQL error log is empty, and I have not found the reason for it so far and searching through the questions usually does not yield an answer so far either.

I found that the daily and weekly cron’s sometimes exit with errors apparently and I am not sure whether that might be related to the issue. Since MySQL does not exit with an error and does not show any errors in the logs and is not running when I ssh into the machine, a simple starting the service fixes the issue.

I have solved it in the past by having another cron-job checking whether MySQL is running and start it if not but that’s not clean and I’d love some help to figure out what the actual problem is. CPU, memory, disk and load are nowhere near any limit to have an impact on either cron or MySQL to be affected by it

Any suggestions or experience with how to fix this possibly?

Thank you



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!

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.

Thank you @andmoo I ran the command and did not get any output, so nothing in there.

I have monitoring enabled, no spikes or anything weird looking in the graphs from what I can see. This is currently running on the smallest, 1GB Memory, 25GB Disk node.

free -h shows the following, where the 83M free on Memory is interesting, given the total and used. root@definingthenextdecade:~# free -h total used free shared buff/cache available Mem: 985M 179M 83M 5.4M 722M 635M Swap: 1.0G 780K 1.0G

@benmateev

thanks for the update. I’d remain confident that the applications are competing for the little spare RAM on the Droplet. Depending on what’s installed on your WP instance and what kind of traffic you’re seeing you could be cutting it fine with memory on a small droplet such as this.

In my experience you have some options now;

  1. Upgrade the droplet
  2. Analyse and tune MySQL queries using PMM/pt-query-digest (or tune Apache2 for memory usage)
  3. Move your database to a dedicated Droplet.

I understand that budget could be a factor here but you’ve bought some time with the swap space and at some stage, if your WP instance starts to pick up more traffic you might see an issue sooner rather than later.

BR

Andmoo

Hey everyone,

it happened again, actually twice, now I am going through logs and I dont see any error, nothing, no spikes, no weird requests, memory is fine, the swap file didn’t help.

It feels like there is something wrong, but the answer for this error are the same in a lot of threads on this page and I dont see an answer that has actually helped, unfortunately.

I am gonna upgrade the droplet as a next step to see whether that helps, though I am already using W3 Cache and Cloudflare as a CDN. I get the feeling that there is some basic error in the configuration of the droplet that keeps coming back - espcially given that I have experienced the same error with the same results and no help from the logs for the past few years trying to one a One-Click Install droplet.

Ben

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.