Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Couple of days back I had a table with 7GB of data and it was showing 63MB of overhead in phpMyAdmin and I mistakenly started its optimization and after working of more than 40 mins it corrupted the whole table.

What are the safe practices to avoid table crash?

share|improve this question
up vote 4 down vote accepted

I would say to try to use a different storage engine like InnoDB.

It sounds like you were using MyISAM which isn't crash safe. If you want to continue using MyISAM and it crashes in the future, you can fix it with an external program called myisamchk.

 myisamchk --force --key_buffer_size=512M --sort_buffer_size=64M --read_buffer_size=8M --write_buffer_size=8M  /path/to/datadir/*/*.MYI
share|improve this answer
Any idea how long it will take to repair 7GB table? – Rick James Sep 14 '11 at 19:12
It really depends on your system, but myisamchk has parameters, like increasing memory it can use which can make it faster. – Jonathan Sep 14 '11 at 20:10
thx, wanted to give rep but I lack points. :) – Rick James Sep 14 '11 at 20:34
+1. Nice info about myisamchk. – StanleyJohns Sep 14 '11 at 22:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.