Why do I often get this error when accessing phpmyadmin?

Hello everyone,

I have a VM from DO, and my distro is Ubuntu 16.04. I have the following software installed: Apache2: 2.4.18 php: 5.6.26 mysql: 5.7.15 phpmyadmin: 4.5.4

I often get this error message on my wordpress site:

Error Establishing a Database Connection

So when I go to check my phpmyadmin and I try to log in I get the following error messages:

This above the login form

#2002 - No such file or directory<br />The server is not responding (or the local server's socket is not correctly configured).

and this under the login form

Connection for controluser as defined in your configuration failed.

Here a screenshot for better illustration phpMyadmin Screenshot

What I have done till now is always restarting my vm to get rid off that problem:

sudo reboot

After rebooting I am able to use my wordpress and phpmyadmin normally without any errors!

But I believe there is a better solution! It’s really frustrating to get that error randomly! Please help me.


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.

What is your droplet size? One of possibilities is that MySQL servers gets killed for some reason. For example that can be due to sufficient memory. For beginning I would verify syslog for Out Of Memory killer logs. Open /var/log/syslog with your favorite text editor:

  1. nano /var/log/syslog

Look thought it and if you see Out of memory killer logs. If you see any OOM messages there, that means your droplet needs more memory to run killed process (e.g. MySQL). In that case, I can recommend adding Swap to your droplet or resizing it to bigger one. If this is not the case, we can try looking for MySQL logs, but this is what I would first check. :)