Jump to content


Photo

Recover DB after HDD crash


Best Answer requinix, 14 November 2017 - 08:14 PM

Did you copy all the files? Each table has 2-3 files, and InnoDB has other stuff. Did you do mysqlcheck with

--all-databases --extended --verbose
Copy literally everything from the old data/ directory to the new one. Go to the full post


  • Please log in to reply
7 replies to this topic

#1 phdphd

phdphd
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 13 November 2017 - 11:24 AM

Hi All

I need a piece of advise. My computer crashed, and after the last DB backup I had made some updates to my database, which got lost.

I placed the HDD in an external HDD box and managed to recover all my data. So now I have my wamp folder and subfolders (bin, phpapps, www, …) in a temp folder in my new computer.

Once I have reinstalled the wamp app bundle, is it safe to just copy the folder of my database (bin\database\mysql-5.7.11\data\<my_database>) to the same path? If not, is it possible to first run mysqldump against the DB in the temp folder?

Thanks !



#2 requinix

requinix
  • Administrators
  • Lazy Administrator
  • 9,374 posts
  • LocationWA

Posted 13 November 2017 - 12:46 PM

You can't run mysqldump unless you have a running database.

Copy all the data files and use mysqlcheck to look for errors.
The Reimann Zeta Function Trolley Problem | "Summer is when I, the great ice fairy, can show my true power!"

#3 phdphd

phdphd
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 14 November 2017 - 06:54 PM

I copied all the data files. In phpmyadmin, the database is listed, along with the table names, but if I click a table name, I get a "table does not exist" error. This is confirmed with mysqlcheck (for all tables).



#4 requinix

requinix
  • Administrators
  • Lazy Administrator
  • 9,374 posts
  • LocationWA

Posted 14 November 2017 - 08:14 PM   Best Answer

Did you copy all the files? Each table has 2-3 files, and InnoDB has other stuff. Did you do mysqlcheck with
--all-databases --extended --verbose
Copy literally everything from the old data/ directory to the new one.
The Reimann Zeta Function Trolley Problem | "Summer is when I, the great ice fairy, can show my true power!"

#5 phdphd

phdphd
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 14 November 2017 - 08:25 PM

You are quicker than the light... I indeed initially just copied the data of the DB folder. Now all tables are listed. mysqlcheck is running ...



#6 phdphd

phdphd
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 14 November 2017 - 08:47 PM

Results of mysqlcheck : all tables in all databases are ok, except for the tables of database performance_schema, for which it says "The storage engine for the table doesn't support check". Is this an issue or a normal result for that table ?

Anyway, thank you very much for your help!



#7 requinix

requinix
  • Administrators
  • Lazy Administrator
  • 9,374 posts
  • LocationWA

Posted 14 November 2017 - 09:00 PM

performance_schema is special. Don't worry about it.
The Reimann Zeta Function Trolley Problem | "Summer is when I, the great ice fairy, can show my true power!"

#8 phdphd

phdphd
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 14 November 2017 - 09:01 PM

Great !






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users