[mythtv-users] Repair mysql tables after power failure?

Jonathan Rogers jonner at teegra.net
Thu Oct 4 07:15:35 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Arfsten wrote:
> I had a power outage at my house this morning. I got an email that almost 
> all my mysql databases are either still open by a user or were not shut down 
> properly. Obvioulsy I know that they were not shutdown properly because of 
> the power outage.
> 
> My question, Is there anything I have to do as far as repairing them or 
> anything like that or will myth "just work" despite them being shut down 
> improperly?

I had the exact same problem since a MythTV machine I set up in my
brother's house several miles away from me sometimes has lost power and
sometimes has had to be forcibly shut down (which is a separate issue I
think I've solved). I'm using Ubuntu and the Debian/Ubuntu mysql
initscript does check for crashed tables at mysql startup, but doesn't
fix them all, probably to avoid further damage.

It seemed stupid that I had to manually run mysqlcheck in a robotic way,
though I could do it remotely. I didn't want my brother and his wife to
have to wait for me to do that after a forced shutdown or wait for a
daily run of optimize_mythdb.pl, which also occurs. I consulted the
mysql manual and found that I could add "--myisam-recover=force" to the
mysqld startup options. Since my tables are myisam, this seems to cause
mysqld itself to repair the tables when it finds they are crashed. I
realize this could damage them further, but I have daily database
backups, so having to restore the database wouldn't lose that much. I
tend to think this option should be a default for tables that aren't of
life and death importance.

Jonathan Rogers
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHBJMWMs6f82yVS5wRAqR5AJ41qT1Dv28DaA3il8/gx2Vca7tQKQCfd20c
O6r5GmgUdG1djQmxWU2/ny8=
=JJLW
-----END PGP SIGNATURE-----


More information about the mythtv-users mailing list