I recently got the following error
DB function failed with error number 145
'TABLE\ jos_session' is marked as crashed and should be repaired
SQL=SELECT session_id FROM jos_session WHERE session_id ....
This was accompanied by my site crashing. I fixed it by truncating the table
truncate table jos_session
It can also be fixed by repairing the table
repair table jos_session
My question is, how can we prevent this table from crashing to begin with.
There are several reasons this could have happened, so check the manual to see what might have happened in your case. We use SQLyog/monYog to monitor our databases and make sure nothing out of the ordinary in happening that might trigger such an error. Bottom line – you’ll have to do some digging to see what might cause it to happen again.