1

All of a sudden I cannot log into my control panel. Does anyone have any advice as to where I could start to get this repaired?

A Database Error Occurred
Error Number: 145

Table './db-name/exp_cartthrob_cart' is marked as crashed and should be repaired

SELECT `cart` FROM (`exp_cartthrob_cart`) WHERE `id` = '3099' LIMIT 1

Filename: third_party/cartthrob/models/cart_model.php

Line Number: 28
3

Your best bet would be to attempt to repair the table via a database management utility outside of the EE control panel. Does your web host offer anything like a PHPMyAdmin interface, or do you have any experience with standalone MySQL clients like Sequel Pro? Those utilities should expose table repair functionality. I'd start there first.

Before you proceed beyond this point, I probably cannot emphasize enough that you back up your database. If you don't know how to do this, ask. The following could potentially further complicate the issue, and it would be best if you had a semi-safe point to roll back to.

That said, you could modify the following script with your database credentials, upload it to your server, and execute it:

<?php

// Taking the information in brackets from your /system/expressionengine/config/database.php

$db_con = mysql_connect('[YOUR DB HOSTNAME]', '[YOUR DB USERNAME]', '[YOUR DB PASSWORD]');
mysql_select_db('[YOUR DATABASE NAME]',$db_con);

$q_result = mysql_query('REPAIR TABLE exp_cartthrob_cart');

if ( ! $q_result )
{
    die('Total failure. I recommend panic.');
} else {
    echo mysql_result($q_result,0) . ' has been repaired.';
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.