I have had sporadic mysql failures. Cpanel/WHM successfully restarts it and I am notified via e-mail and text message, but I have yet to be able to determine what is causing the failure. From what I can tell nothing is logged ether by cpanal, mysql or the system about the failure.
My questions is can cpanel or mysql be configured to log what the issue is?
Any other ideas are also welcome. I have the max connections for mysql and apached limited to match the servers capacity.
Have you checked the MySQL error logs? The location will vary per setup and OS, but it should be under your MySQL data directory. For example, the error log on this server is:
You may have to do a little bit of digging, especially if you have changed hostnames a few times as there will be several .err (error) logs present. If you find the log file and it doesn't show anything helpful, what version of MySQL are you using?
Interesting enough there is not a errror but what looks like a standard restart:
080123 9:50:05 InnoDB: Starting shutdown...
080123 9:50:08 InnoDB: Shutdown completed; log sequence number 0 45496
080123 9:50:09 [Note] /usr/sbin/mysqld: Shutdown complete
080123 09:50:09 mysqld ended
080123 09:50:10 mysqld started
080123 9:50:11 InnoDB: Started; log sequence number 0 45496
/usr/sbin/mysqld: ready for connections.
Version: '4.1.22-standard' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Edition - Standard (GPL)
Now I did notice a older error but it was from some time ago. Since the error is not the same it is tough to tell if it is related:
071225 12:00:01 [ERROR] Can't create thread to kill server
libgcc_s.so.1 must be installed for pthread_cancel to work
mysqld got signal 6;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 289279 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
Cannot determine thread, fp=0xae1a9c64, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at (nil) is invalid pointer
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.