Copied MySQL Database Files but Tables are not Showing in PhPMyAdmin

10,815

Your ibdata1 file contains all your metadata for your database, tablespaces, indexes, table structure etc... It should always coincide with the last date that everything else was touched which appears to be 04/19/2015 for you. If your ibdata1 file has not been backed up since 08/13/2014 that means that all your metadata would be out of wack with your table (.frm and .ibd) files. So while you can see the tables in your database you cannot access the data because the tablespaces are completely misaligned. In which case you have the infamous case of Schrodinger's mysql table. Briefly explained, Mysql believes that the table exist and doesn't exist at the same time. I will refer you to this stackoverflow for more information.

I do not believe Innodb_force_recovery will work in your case but I guess it can't hurt to give it a shot. Percona has a recovery tool for innodb to fix metadata (tablespaces) that has become out of sync. You can give that a shot. From experience it is not easy to work with, you can only fire it up in linux, it is not necessary going to work, and there is very little on the web in terms of working with the tool.

My recommendation would be to scrap what you can and start over.

Share:
10,815
alkey
Author by

alkey

Updated on June 04, 2022

Comments

  • alkey
    alkey almost 2 years

    I recently tried to restore a Wordpress site using backed up files. I put my faith in the Wordpress "export-all content" function that in fact exports very little.

    I kept backups of the WAMP files and have read several posts that successfully copy the backed up database files into the new location and the database works fine:

    Reinstalled WAMP, Wordpress Tables Not Found BUT Are in PHPMYADMIN

    Restore the mysql database from .frm files

    The annoying thing is that these are not working for me. I have tried two things:

    1. Copied the database folder and the backed up ibfiles into the places. Once I do this and open PHP admin, the WP tables are listed but I get the error message that they do not exist. See the attached screenshot. screenshot of copied files and problem

    2. I created a new database with the same name and did a fresh wordpress install which created empty tables. I then copied the backed up folder containing the .frm files into the newly created folder and replaced the ib files. The problem this time is that WAMP would not start and I was denied access to PHPMyAdmin. Error message 2002 actively refused.

    One thing I have noticed. In the backed up file the ibdata1 file had not been backed up since 13/08/14. Whereas the ib_logfile1 and iblogfile() were 29/03/2015 and 19/04/2015. Could it be possible that my backup program (WD Smartware) was not doing a sufficient job at backing up my files? If so am I wasting my time and should I just start rebuilding from scratch.

    Thanks for your help.

  • alkey
    alkey about 9 years
    Thanks for your suggestion, I do not have access to linux right now so I would not be able to run the tool even if I wanted to. I dreaded having to start over but I guess I will just learn my lesson for next time. Thanks again
  • BK435
    BK435 about 9 years
    Your welcome allan..Srry to be the bringer of bad news though...I hope the rebuild goes smoothly...
  • Vic Seedoubleyew
    Vic Seedoubleyew over 6 years
    Your first link is broken, the post has been deleted