Database stopped responding

April 16, 2016 1.6k views
Ubuntu WordPress PHP LAMP Stack

Hi there

I have been running a Laravel website and a Wordpress subdomain with Apache, MySQL, and Ubuntu DigitalOcean. Today I started getting this error:

Whoops, looks like something went wrong (error from main Laravel website:)
Error establishing a database connection (error from Wordpress blog)

Apparently, it looks like an error from its database. I tried accessing phpMyAdmin but I could not login.

Then, while logged in with “root”, I tried mysql -u root -p. After providing correct password, I got this error:

ERROR 2002 (HY000):  Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

What could be the reason? Has the DB been compromised. Someone might have got an access through phpMyAdmin and deleted both DBs. But I should still be able to login to MySQL. I do have a backup of both DBs.

Any suggestions/help please.

1 Answer

Hey there,

Thank you for reaching out to us!

I would make sure that MySQL is actually running. It may have crashed if the Droplet ran out of memory. Usually MySQL would be the first thing to go during resource contention for memory. I would try a service mysql restart or a reboot before jumping to the thought that the databases have been destroyed.

Happy coding,

Jon Schwenn
Platform Support Specialist

Have another answer? Share your knowledge.