• I have set up xampp on my computer to refurbish my site. Xampp closed down overnight, and now I can’t log in to WordPress through localhost – it just keeps throwing me back to the front end of my localhost version (and that looks fine). I can open phpmyadmin. Stupidly, the last backup I have is the duplicator backup of my live site, and I’ve been working on the localhost version for a week now.

    I found an error message the wp_users was corrupt; try to repair it, and the repair worked, and all the other tables seem fine. But I get the message #1034 – Index for table ‘wp_usermeta’ is corrupt; try to repair it” on the wp_usermeta table, and repair is not working.

    I’ve tried disabling plugins by renaming the wp-content/plugins folder. I’ve also tried renaming my theme folder (starter blog) but that didn’t seem to do anything at all to the front end view.

    Any ideas for what else I can try? I will be an adoring fan of anyone who can save my week’s work. (Most of the time has been spent editing old posts and setting featured images for them, so even if I had to reinstall wordpress, or the theme it would be ok).

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter lindawoodrow

    (@lindawoodrow)

    I don’t know if this is relevant or useful either: One of the forums I looked at suggested

    `8) If ‘Repair’ fails no choice but to ‘DROP TABLE user’ ….
    (9) Recreate ‘user’ table from the distribution backup by copying the following 3 files.

    C:\xampp\mysql\backup\mysql\user.frm
    C:\xampp\mysql\backup\mysql\user.MYD
    C:\xampp\mysql\backup\mysql\user.MYI
    to

    C:\xampp\mysql\data\mysql\`

    My problem is that user.frm is there, but I cannot find user.MYD or user.MYI in that folder.

    Try with below step.

    problem #1034-Index for table 'db' is Corrupt; try to repair it in phpmyadmin solution.
    
    step:1 Run these two queries:
    
    REPAIR TABLE mysql.db
    REPAIR TABLE mysql.user
    Run the following query for the damaged table
    
    REPAIR TABLE mysql.db
    REPAIR TABLE mysql.user
    Thread Starter lindawoodrow

    (@lindawoodrow)

    Unfortunately Sumit that hasn’t worked. For the first queries, if I run them in the database for the site, it says

    `errors were found during analysis.

    This type of clause was previously parsed. (near “REPAIR” at position 23)
    SQL query: Copy

    REPAIR TABLE mysql.db REPAIR TABLE mysql.user;

    MySQL said: Documentation

    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘REPAIR TABLE mysql.user’ at line 2`

    For the second ones, it won’t let me run any query at all on the corrupt table, it just gives me the message to try to repair it.

    Dion

    (@diondesigns)

    Using phpMyAdmin, go to the wp_usermeta table, click the Operations tab at the top, and try to copy the table to wp_usermeta2. Make sure the “structure and data” option is selected. If that succeeds, then rename the wp_usermeta table to wp_usermeta3. Now go to the wp_usermeta2 table and verify its contents. If the rows appear to be OK, then rename wp_usermeta2 to wp_usermeta. If you were able to copy the table and the new table contents appear to be OK, then this will fix the problem. Otherwise, rename wp_usermeta3 to wp_usermeta and try the following.

    If the above didn’t work, you can run the following four queries in phpMyAdmin, and the corrupt index will be deleted and a new one will be created. Only do this as a last resort, because if anything goes wrong during these queries, the table itself may become corrupted beyond repair.

    ALTER TABLE wp_usermeta CHANGE umeta_id umeta_id BIGINT(20) UNSIGNED NOT NULL;
    ALTER TABLE wp_usermeta DROP PRIMARY KEY;
    ALTER TABLE wp_usermeta ADD PRIMARY KEY (umeta_id);
    ALTER TABLE wp_usermeta CHANGE umeta_id umeta_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
    Thread Starter lindawoodrow

    (@lindawoodrow)

    Hi Dion, thank you for getting involved. If I copy, I get a green notice that it is copied, but wp_usermeta2 does not appear in the list of tables. I also get a notice

    Some erros have been detected on the server. Please look at the bottom of this window

    .
    At the bottom is:

    `Notice in .\libraries\classes\Controllers\Table\OperationsController.php#453
    Undefined offset: 0

    Backtrace

    Routing.php#192: PhpMyAdmin\Controllers\Table\OperationsController->__invoke(
    ,
    array,
    )
    index.php#43: PhpMyAdmin\Routing::callControllerForRoute(
    ,
    string ‘/table/operations’,
    ,
    ,
    )`

    Before I do the last resort, does that shed any light?

    Dion

    (@diondesigns)

    That probably means something went wrong during the copy that phpMyAdmin didn’t understand, most likely due to corruption in the table. (It may also be a bug in phpMyAdmin.)

    Since this is on Xampp, go ahead and run the above four queries to delete the corrupt index and create a new one. Hopefully it works!

    Thread Starter lindawoodrow

    (@lindawoodrow)

    Thank you Dion. I’ll let you know the outcome, but in any case I am eternally grateful!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘#1034 – Index for table ‘wp_usermeta’ is corrupt; try to repair it”.’ is closed to new replies.