I am using VPS . with Ubuntu 12.4 (nginx server +mysql) .Am install LEMP with the digitalocean article for installation… and it works fine… and then after two days, i get an problem with my site … (ERROR CONNECTING DATABASE) …so i have to manually start the mysql service …(service mysql start) …
So what the problem is ? and how to keep the mysql service live all the time ?
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.
MySQL can eat up a lot of resources if having to make a lot of calls to the database. To optimize your site and, as a result, get rid of that error, follow the steps outlined in the following guides: <br> <br>1.) <a href=“https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04”>How To Add Swap on Ubuntu 12.04</a>; <br> <br>2.) <a href=“https://www.digitalocean.com/community/articles/how-to-install-and-use-memcache-on-ubuntu-12-04”>How To Install and Use Memcache on Ubuntu 12.04</a> (see Kamal’s comment of Jun. 30, 2013 for instructions on configuring memcache for use with Nginx); <br> <br>If you’re using WordPress, you’ll also be interested in: <br>3.) <a href=“https://www.digitalocean.com/community/articles/how-to-install-wordpress-nginx-php-and-varnish-on-ubuntu-12-04”>How To Install Wordpress, Nginx, PHP, and Varnish on Ubuntu 12.04</a>.
Your droplet is running out of memory, try adding swap: <br> <br><a href=“https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04”>https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04</a>.