MySQL crashes daily on VPS with Ubuntu Server 12.04 - How can I find the error or conflict? Every day for the past four days, my website server crashes at least once. (Error establishing database connection.

As long as I catch it, I simply have to do the following command:

sudo /etc/init.d/mysql start

and its up and running in about 30 seconds.

I imagine this is not enough info to diagnose, but I am sure there is an error log or something I can pull which would be more useful.

It is running on a single core w/ 512 mb memory. The whole site is funneled through CloudFlare, so even at peak traffic it never really sees an average load above 0.25 when checking htop. 

One random thought - I have an embedded twitter feed that shows latest tweets. It happened today immediately after the tweet was posted. I have no idea if there is a connection and didn't pay attention the last few days when tweeting. Just thought I would throw it out there in case someone knows of a conflict.

Any ideas?

Thank you.
Check the value of the variable "log_error":

select @@log_error


or

show variables like 'log_error'


It defaults to /var/log/mysqld.log on a RHEL6 server though can be different.

Then check this log file - it will generally give you a reason why it's failing.  

Alternatively, if the service is being killed because the server is running out of memory, check the system log:

/var/log/messages 


For the "Out Of Memory killer" doing it's thing or any other messages that might be relevant around the time that the server died.