UBB.Dev
Posted By: Helice SQL errors galore! Help, Help! - 07/18/2002 5:29 PM
Everything was dandy with my boards when I went to bed last night.

This morning my boards all have SQL errors inserted all over the page to the tune of:
SQL ERROR: Unable to do_query: UPDATE w3t_Users SET U_SessionId = '8c0469dac676293843590e170b8f17f0' WHERE U_Number = 871
Incorrect key file for table: 'w3t_Users'. Try to repair it

SQL ERROR: Unable to do_query: SELECT COUNT(*) FROM w3t_Users WHERE U_Approved='yes'
Got error 127 from table handler

I WOULD try to go into the admin section to close the boards and run the "Repair" command, but I can't get into thte admin pages. Please someone, give us a helping hand quickly!

Helice
http://forum.foolmoon.com

Posted By: Rick Re: SQL errors galore! Help, Help! - 07/18/2002 5:52 PM
This sounds like you will probably need to do a direct repair of that table. If this is your server then you should be able to run myisamchk on your database files to check and repair corruption. An alternative would be to install something like phpmyadmin which should let you repair the table from a browser.
Posted By: Helice Re: SQL errors galore! Help, Help! - 07/18/2002 6:01 PM
I have phpadmin, but I can't find any option that says "Repair"... can you tell me what to do?
Posted By: Rick Re: SQL errors galore! Help, Help! - 07/18/2002 6:09 PM
On newer versions of mysql you can normally just do:

REPAIR TABLE w3t_Users
Posted By: Helice Re: SQL errors galore! Help, Help! - 07/18/2002 6:15 PM
Dear Scream,

I've done this, and received the following report from phpmyadmin:

Table Op Msg_type Msg_text
threads.w3t_Users repair info Wrong block with wrong total length starting at 1570136
threads.w3t_Users repair warning Number of rows changed from 631 to 5170
threads.w3t_Users repair status OK


It said "repair status OK", but my pages now have twice as many SQL errors as before the repair. I'm really desperate now.
Posted By: Helice Re: SQL errors galore! REPAIR fixed it - 07/18/2002 6:21 PM
Whoa! Cancel that...


Out of desperation and fear I ran the REPAIR TABLE w3t_Users command about 25 times...


every time I ran it, it corrected the number of rows in the table until I got a result (finally) that just said OK. And now it appears the SQL errors have vanished!

Thank you so much for giving me the right command to fix it, I was about to drop from an aneurism, but good heavens! Why did this happen, and how can I prevent it from happening again?!

Thank you Scream,

Helice
http://forum.foolmoon.com
Posted By: Rick Re: SQL errors galore! Help, Help! - 07/18/2002 6:21 PM
Hmm, is that your forum.fullmoon.com site? I just went, registered and logged in and didn't see any sql errors.
Posted By: Rick Re: SQL errors galore! REPAIR fixed it - 07/18/2002 6:26 PM
Ah, you replied while I was testing Mysql tables can sometimes get corrupted. Can be a variety of things, even when a hardrive fills up. It definitely shouldn't happen that often. Reports of table corruption here are pretty rare. If it does start to happen frequently it could be a sign of an underlying problem which you might want to talk to your host about if you're on a hosted server.
© UBB.Developers