HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Resolved Database Issue #144 - Corrupted Table

Login / Search

 [ Join | More ]
 Add topic 
Posted
Item has a rating of 5 (Liked by Chris Graham)  
Rating:
#101532 (In Topic #19914)
Avatar

Well-settled

So, I am not sure what caused it, but I was able to resolve it so I figured I would share the wealth. I use bluehost.com for hosting and have shell access setup.

Error

Here is the error I was getting in phpmyadmin (Getting something similar in OCPortal Admin):​

Code

#144 - Table './<database>/<tablename>' is marked as crashed and last (automatic?) repair failed

This error caused a stack dump when getting into the Tools or Status area of the Admin area, as well as a few other issues here and there.

Resolution

I logged into my domain using putty and used:​

Code

$ mysql -u <username> -p

From there I switched to the database I was having issues with:​

Code

$ use <database>

Checked the status of the table:​

Code

$ check table <tablename>;

This is what I got as output:​

Code

+--------------------------------------+-------+----------+---------------------------------------------------+
| Table                                | Op    | Msg_type | Msg_text                                          |
+--------------------------------------+-------+----------+---------------------------------------------------+
| database.tablename                   | check | warning  | Table is marked as crashed and last repair failed |
| database.tablename                   | check | warning  | Size of datafile is: 20652 Should be: 19564       |
| database.tablename                   | check | error    | Key in wrong position at page 14336               |
| database.tablename                   | check | error    | Corrupt                                           |
+--------------------------------------+-------+----------+---------------------------------------------------+
4 rows in set (0.02 sec)
​​​​​​
Now we know that this is the table that is corrupted, run the following command:​

Code

$ repair table <tablename>;

You should get output similar to:​

Code

+--------------------------------------+--------+----------+----------------------------------------------------+
| Table                                | Op     | Msg_type | Msg_text                                           |
+--------------------------------------+--------+----------+----------------------------------------------------+
| database.tablename                   | repair | info     | Delete link points outside datafile at 18580       |
| database.tablename                   | repair | info     | Found block that points outside data file at 18908 | 
| database.tablename                   | repair | info     | Found block that points outside data file at 18924 |
| database.tablename                   | repair | info     | Found block that points outside data file at 19064 |
| database.tablename                   | repair | info     | Delete link points outside datafile at 20152       |
| database.tablename                   | repair | status   | OK                                                 |
+--------------------------------------+--------+----------+----------------------------------------------------+
6 rows in set (0.00 sec)
​​​​​​
Everything should be good now, but rerun the check command and you should get:​

Code

+--------------------------------------+-------+----------+----------+
| Table                                | Op    | Msg_type | Msg_text |
+--------------------------------------+-------+----------+----------+
| database.tablename                   | check | status   | OK       |
+--------------------------------------+-------+----------+----------+
1 row in set (0.01 sec)
​​​
So something I thought was going to be a huge issue, wasn't. Passing along this easy fix.


Last edit: by rteicheira

Russ Teicheira
http://vvarmachine.com or http://vvarnc.com - OCPortal Install
http://www.russteicheira.net
 - Profile Site that needs updating
http://projectxfire.com - Tech Blog that I need to get back to
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: