Question

Apache2 and MySql keep stopping

I have a DO Droplet server and every day or so I have to restart apache2 and mysql -

“CRI: Error connecting to MySQL Server: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) (#2002) - the site owner should contact their hosting provider for assistance.”

when access the website. Why is this happening, and how to fix it please? Many thanks Pa


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.

May I revive this topic. My mysql service kept stopping and showing this error to end user

DibiDriverException: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

this command show nothing

tail /var/log/mysql.err

using the lowest DO droplet specs

Please help

Thanks for the help. Just waiting for it to stop again now so that I can check the logs. Things never break when you want them to lol <br>

@paul: Error logs are usually found in /var/log. On Ubuntu, MySQL’s error log is /var/log/mysql.err <br> <br>You can output the last few lines of that file using the ‘tail’ command: <br> <br>tail /var/log/mysql.err