0

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?

1 Answer 1

4

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.

http://dev.mysql.com/doc/refman/5.0/en/myisamchk.html

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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