MySQl savior command

I have a couple of MySQL databases I support....both at work and at home. Some of the databases can grow in size to about 20GB or so. Occasionally, those databases can suffer from power outages, and get left in a locked state. Unfortunately this happened to me recently, and a pretty important (to me) database got locked.

After a quick Google search, I was able to find the needed command to fix up the MyISAM tables:

myisamchk --silent --force --fast --update-state /path/to/mysql/databasename/*.MYI

This simple command was able to repair the tables, and I was able to once again access the data. I'm documenting this in multiple places, so I'll never forget this. It saved me from a ton of extra work, and took just a few minutes to run.


Subscribe to RSS - blogs