Problem:
An error existed on my website and the log file throws the following status:
#1194 - Table [TABLE_NAME] is marked as crashed and should be repaired
Analysis
This seems to happen right after I was executing an action on my development website and the system shuts down and crashed. It seems that this is one of the common reasons why the issue happens (c/o of
Stackoverflow). Aside from this, there might be some other factors that might be the reason why it happens:
- harddisk failure
- sudden server reboot
- server crash
- firmware problems (raid controller or bios)
- defects in the cabling
Solution
There are many ways to solve this, here are the common solutions:
- Using PHPMyadmin
If you are using PHPMyadmin, this might be the easy way out of this problem.
- First is log-in to your PHPMyadmin panel
- Pick your database and go select/check the table that is causing the trouble.
- Scroll down on the bottom part of the page to see a drop-down box and select Repair table
- Via Console or Command Line(CLI)
If you have access on the console or SSH, you may want to do it via the said option.
- Log in to your SSH access
- Log in to your
mysql
client access, (e.g. mysql -u [USERNAME] -p
)
- Select the database (e.g.
use [DATABASE_NAME]
)
- Then type the following command:
REPAIR TABLE [TABLE_NAME]
This is the same to what the PHPMyadmin does except that the first approach uses a GUI for easier operation. I suggest the first method for less techie users.
After doing one of the said solutions above, restart your MySQL server and that should solve your problem.
We usually encounter this kind of error - well, not usually. It's more like we ALWAYS encounter this one especially when we're back from the holidays.
ReplyDeleteAnd it's always THAT one table (which fortunately is not 'THAT' critical when crashed).
Power trip daw ung cause.
it does happen during power failure but if it is just on one table.. it would be best to investigate further on it..
ReplyDeleteAun nga. XD
ReplyDeletekasi bakit yung table na yun lng. XD
Hahaha.
As of now, our support team is really undermanned so nobody can really make some "investigation". ):
Reactive lng as of now. If mag`crash ulit, fix.