How to recover a database in MySQL

-1

I had a problem with a client that the operating system stopped working. I was able to access the disk and there is a MySQL database inside the C:\ProgramData\MySQL\MySQL Server 5.7\Data\BDados folder that contains the .FRM and .IDB files.

How can I recover this database?

I have already copied the files from this folder to my computer folder but I can not access it. When I enter through the MySQL Workbench the tables appear but I can not access the content. It always gives the error:

  

Error Code: 1812. Tablespace is missing for table bdados . clientes

I would like your help to resolve this situation.

    
asked by anonymous 15.11.2018 / 17:29

1 answer

0

You have a tip on this site that might help you:

First you create a new database with the tables.

Then delete the newly created files using the DISCARD

ALTER TABLE newdb.table1 DISCARD TABLESPACE;

Then copy all the .ibd and .frm files from the backup to the database folder, then access the database.

Ask MySQL to accept the new files using the IMPORT statement.

ALTER TABLE newdb.table1 IMPORT TABLESPACE;

This can help you retrieve the tables from the database.

    
15.11.2018 / 17:59