Question

Droplet Management Basics

Hi, some of our droplets (running wordpress) are experiencing the dreaded: “error establishing a database connection”

It’s happening too much for my liking and we are considering a moving away from DO if we can’t resolve it soon.

I am trying to learn SSH commands for logging in and controlling / managing a server.

The droplets are Wordpress sites running on Ubuntu.

I understand how to login, but i am sure there are a lot of useful commands i need to learn such as restarting the server etc.

I would greatly appreciate any help you have on this, and any commands which you think would be useful based on the above setup (Ubunto / Wordpress)


Submit an answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Problem solved with this code…

sudo start mysql

Regards, Beautiful Jogja - Indonesia

@mosaic - Errors are not specific to DigitalOcean and could pop up for any number of reasons on any VPS deployed to any provider and at any time if the software, MySQL in this case, is not tweaked and / or tuned properly. You could “downgrade” to shared hosting, though you would, as a result, lose the ability to customize your server and would thus be stuck with whatever configuration the shared host sets.

The specific connection error that you’re referencing could be due to poor configuration (such as RAM being over-allocated), lack of configuration or problems elsewhere. To really dive deep in to the error and the configuration, MySQL Tuner should be used (as I referenced in another post of yours IIRC). It will allow you to see how much RAM could potentially be used by MySQL (note: if MySQL is configured to use more RAM than the Droplet is allocated and swap won’t cover the excess, MySQL is going to crash as MySQL will use whatever it’s allocated).

That said, there’s not a specific one-shot variable that tells MySQL how much RAM it can use (when compared to MemCached or Redis, which has one configuration variable for RAM allocation). MySQL uses a combination of InnoDB settings as well as buffers, query cache etc to allocate RAM. If these are set too high, MySQL will naturally crash as a result of lack of RAM/Memory.

Thanks for your reply.

Could you provide details on: “Check your syslog for OOM killer on mysqld”

Thanks again for your help.