Mysql – Repair Database using .FRM .IBD .OPT Files ( Hard copy thesql folder )

backupMySQLquerytable

I had a crash on my server.
The only thing I could do was hard copy the mysql folder
Now I am trying to access my database again through the PHPMyAdmin interface.
Some databases (mostly WordPress) run and run well
But some databases are only viewed and their content is not displayed

For example
table doesn't exist

I used REPAIR TABLE query but it doesn't help

enter image description here

Best Answer

FINALLY Thanx Dexter!

Answer link after about 6hours searching the internet: https://stackoverflow.com/a/56641702/12873930

###Files require to restore

xampp(old folder)/mysql/data/

ibdata1
ib_logfile0
ib_logfile1
<databasename>/*.frm
<databasename>/*.ibd

###Step 1

  1. After installed the same version of xampp.
  2. Do not start the apache or myql

###Step 2

  • Go to the mysql/data folder and replace the ibdata1, ib_logfile0, and ib_logfile1
  • Now copy paste your database folder from your old xampp backup to the newly installed xampp folder c:/xampp/mysql/data/ that contain .frm and .ibd files, If you are not sure try with one database.

###Step 3

  • Go to c:/xampp/mysql/bin and look for my.cn.
  • Open the my.cn file and look for #skip-innodb and under that look for the line that says innodb_log_file_size=5M change it to 170M. innodb_log_file_size=170M. This is your log file size and if you are not sure just set it to 170

###Step 4

  • Now open the file mysql_start.bat (Windows Batch file) that is in the c:/xampp/ directory.

  • Add –innodb_force_recovery=6 after the ... --console

     ....
    
     mysql\bin\mysqld --defaults-file=mysql\bin\my.ini --standalone --console
     –innodb_force_recovery=6
     if errorlevel 1 goto error
     goto finish
    

###Step 5

  • Now Start your Apache and Mysql.
  • Go to your phpmyadmin and check for your database and its tables. if you do not get any errors you are on the right track.
  • Stop the Apache and Mysql and copy paste the rest of the databases.