mysql optimize table crash
MYISAM tables are very fragile and get damaged/crash every now and then. First advice is to move to Innodb engine it is simply performed by using alter table command.

Now, to fix crashed MYISAM tables the proper way is to bring the MYSQL down and once it is down and there is no traffic you can fix them using this command line statement:

myisamchk --silent --force --fast  /path/table-name.MYI


Trying to repair/optimise MYISAM tables on a live server usually does not work. From MYSQL CLI the command should be 

mysql&gt; repair table tablename;


instead of optimize table if the table was crashed.