It was running perfectly well until the power went out. Now the safe_mysqld script, which has never failed before, is core-dumping. Any ideas ?
Yes, of course, a UPS! Very helpful tip. I'll remember that. No process was writing to mysql at power-down. The daemon was running, but that was all.
Hmm... maybe I detect the slightest hint of sarcasm there <br><br>Maybe no process was writing to mysql at power-down, but remember, there are very few systems that can shut down instantly without some sort of data-corruption problem. Usually a system can recover, but not always. (did you run fsck?)<br><br>The mysql daemon is not an island on your system, it has to interact with other processes and libraries on the system. All it takes is for one critical piece of data related to this interaction to be corrupted and you have a problem.
Sorry about the sarcasm, but prevention and problem-solution are different animals.<br>Indeed there was data corruption despite no apparent activity. I restored the base tables from the mysql distribution and mysqld came back to life. UPS is on the wish list. Hopefully there is a way to do an automatic shutdown once the UPS kicks in, or else corruption could happen again.<br>
Are you running a cron job every day using mysqldump to back up the tables? (or even every hour, if your data is that critical) It dumps your whole database as straight text, so you can restore anytime. You could even have the cron job save the data by ftp or NFS or even email to another system for redundancy.<br><br>Automatic shutdown is be available for just about every server OS, but exactly how you configure it depends on which one you are using.
It turns out that even a safe shutdown corrupts the base files. I did a normal mysql shutdown, then a normal Unix shutdown. Mysqld refused to come back up. Kept core dumping. I had to restore the base files from the distribution again. A backup copy of the entire mysql database did not help.
mysql 3.22.27<br>NetBSD 1.4.1<br><br>Since mysql server was not available in as an executable for<br>my platform (mac68k), it had to be compiled from source code.<br><br>The mysql client was available as a binary, but I chose to<br>compile it from source code anyway.<br>
Compiling from source is the Only True Way. ;-)<br><br>I'm not familiar with NetBSD or mak68k, but I use FreeBSD/x86 with no problem at all. You might try compiling the latest version (stable: 3.22.32, dev: 3.23.21-beta)<br><br>One question (perhaps stupid, but...) when you shut down your system, are you killing the mysql process manually first? If not, try that and see if it makes a difference. I know, the server should gracefully kill all processes as it shuts down, but maybe that's where the bug is.
% mysqladmin shutdown<br><br>... is how I shut down mysql. I did this before the Unix shutdown. I guess I could try killing the process instead. That would seem wierd. I can also try a new rebuild using the latest source code, but I may save that for a rainy day. I know how to get back up and running as things are now, so when time permits, I'll experiment. Thanks for the thoughts.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.