Report this

What is the reason for this report?

Restarted droplet and now "Unable to establish database connection" - tried to restart mysql and says can't start

Posted on November 19, 2017

Hi. I recently rebooted my droplet due to some issues with performance. Now after rebooting and restarting Nginx and PHP-FPM the website is still down. I tried to restart mySQL but I get the message “ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)”

Any help would be really appreciated as the site is completely down and I’m being flooded with emails of complaint.

Kind regards



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.
0

Thanks for you help. Unfortunately this didn’t fix things and ultimately I’ve had to restore to a snapshot to fix the issue which is unfortunate as I’ve lost a week of work :| I’m going to get some specialist database input moving forwards, lesson learned.

When I type sudo service mysql status I get the response:

mysql stop/waiting

It seems that the MySQL server is not started or does not exist. Please check that you have installed (previously uninstalled perhaps?) MySQL server and that it is running properly. One way to check if MySQL is running is by running any of the following commands:

# ps aucx | grep mysqld
/etc/init.d/mysqld status
sudo service mysqld status

If you are running systemd systems:

sudo systemctl status mysqld.service

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.