MySQL table crashes

Agon

Verified User
Joined
Feb 14, 2005
Messages
18
I had a strange problem with MySQL on DA server.

Some of our clients run websites on CMS, writen by us. Fiew days ago two of them reported a bug: bouth got one of CMS' tables crashed. In all cases it was the same table, used to store site texts.

I repared those tables, but today bouth crased again! Other clients work perfectly. I could be a bug in our CMS, but this CMS is writen on PHP+MySQL and I can't even imagine how PHP could possibly crash a MySQL table. And it is not a hardware problem too - in that case we should find more crashed tables.

It seems that accident took place at night. None of the clients worked with the site at that time.

Any ideas on how to solve this?
 
Personally I would still be looking through the CMS for the bug.

What kind of corruption are we talking about here? When it occurs what is the message the script produces when attempting to access that table?
 
First CMS become unable to write anything in this table. phpMyAdmin reports that table crashed. Later table becomes unreadable ("Table in use" in phpMyAdmin). To repare a table I do "optimize table" function - it helps. As I wrote, there is the same table all the time. So it should be a CMS bug, except two things: our old server worked for two years and this bug was never ocuped, I can't understand, how PHP could damage table structure - it don't read the table files directly.
 
When the table crashes, is any useful information given running check table? (http://sunsite.mff.cuni.cz/MIRRORS/ftp.mysql.com/doc/en/CHECK_TABLE.html)

You said you do optimize table, have you tried repair table? (http://sunsite.mff.cuni.cz/MIRRORS/ftp.mysql.com/doc/en/REPAIR_TABLE.html)

What do MySQL's errors logs say when the crash occurs? (In the MySQL data directory)

It could be any number of things. It is quite easy to do with a php script, all you have to do is not implement proper filesystem locking, then on a busy server...
 
Check table report "Table is crashed" - this is how I figured the problem exists

I don't tried to repair, only optimize. Now it's OK

I cant' find any usefull about this problems in the logs. In fact, there are no records there from 050327 13:24:11 (when every thig was OK) till 050420 12:39:42 (when I figured out the problem)

This table is not used too much - it store site text's for CMS and used only by site admin (published texts stored separatly). So, if it was a filesystem probem - I should get some more crashed tables. Today I check all of the DB's and don't find any more crashed tables at all.
 
Back
Top