Let me start by saying the majority of environments never experience problems of MySQL crashing. I have seen production environments up for years. On my own server I have seen 575 days of MySQL uptime and the problem was hardware, not MySQL.
However it does occur, and the reasons may be obscure.
Confirming mysqld has crashed
To the unsuspecting, MySQL may indeed be crashing and you never know about it. The reason is because most MySQL installations have two running processes, these are mysqld and mysqld_safe.
ps -ef | grep mysqld root 28822 1 0 Feb22 ? 00:00:00 /bin/sh bin/mysqld_safe mysql 28910 28822 0 Feb22 ? 00:30:08 /opt/mysql51/bin/mysqld --basedir=/opt/mysql51 --datadir=/opt/mysql51/data --user=mysql --log-error=/opt/mysql51/log/error.log --pid-file=/opt/mysql51/data/dc1.onegreendog.com.pid
One of the functions of mysqld_safe is to restart mysqld if it fails. Unless you review …
[Read more]