One of my droplets is reporting that it cannot connect to the MySQL server. I’ve tried rebooting the droplet a couple of times but it hasn’t made any difference. If I try connecting to the database via SSH get the following error:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
The droplet is running LAMP on Ubuntu 12.04, and is running a single website (MediaWiki). It’s been fine since I set it up a couple of months ago. I haven’t made any changes to the MediaWiki codebase or to the MySQL database itself since I set it up (apart from adding content to the wiki), so I don’t really understand why it’s suddenly stopped working now.
Any ideas where to start? Where should I be looking re: log files etc?
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!
I had this exact same issue last week. I spent the entire day reinstalling MySql, restarting apache, checking the error logs, upgrading the droplet to a bigger one, posting questions here, contacting DO support and googling the error, but nothing helped.
<br>
<br>I finally just created a snapshot of the droplet and started a new droplet form the snapshot image, then changed the DNS entry for the effected sites to the new droplet and everything worked again. I never did find out why it stopped but it hasn’t been a problem since.
<br>
<br>Try taking a snapshot of your droplet and creating a new droplet from that image. That won’t tell you what happened but it may get you up and running more quickly.
Have you been updating the software packages on your droplet, regularly? If not, execute: <br><pre>sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove</pre>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.