Recover Mysql Table

Asked

Viewed 6,817 times

5

I reinstalled WAMP and did not export the database (.sql), but I have the files ". ibd" and ". frm".

After the installation, I created a blank database and copied to the folder all the files ". ibd" and ". frm", but when trying to open the table via phpmyadmin, an error is returned and informs that the table does not exist.

I did a test with the smallest table, deleted the files, created the table and ran the query below:

ALTER TABLE bd.tabela DISCARD TABLESPACE;

Then I copied the backup files ". ibd" and ". frm" to the folder and ran the query below:

ALTER TABLE bd.tabela IMPORT TABLESPACE;

But there are 2 problems:

  1. The database has several tables and fields, I can’t recreate everything, because I can’t remember all the information.
  2. In the test I did, the information was restored but was not inserted in the respective column, that is, changed the information of several columns.

How to restore my tables and their data?

  • The engine of the tables was Innodb?

  • @rafaels88 yes, it was.

  • Check out this guy: http://www.hexblot.com/blog/recovering-innodb-tables-ibd-and-frm-files

3 answers

1

I do not know if it can help, but here the translation of a document that explains how to do:

Before you begin, you must stop the WAMP. On your old server (in your external SD/USB key) or stored your website, navigate to the Mysql data folder. The path must be similar to this "D: wamp bin mysql mysql5.1.53 data " or "mysql5.1.53" indicates the version of Mysql installed earlier data. Inside the data folder, there should be multiple files and folders. The files contain databases of existing websites and contain a lot of files with the . frm extension we need. You should recognize the file names or database you are familiar with. Copy the folder that contains your website data and all of its content to the folder data directly to your new WAMP installation. It is not necessary to copy the databases installed by standard WAMP data, i.e., "mysql", "performance_schema" and "test". Now restart the WAMP server, and go to phpMyAdmin. You will notice that the database names are present, but the tables are empty ... Don’t despair, that’s normal, we’ll restore your content. Go back to your old server’s data folder: "D: wamp bin mysql mysql5.1.53 data ". A file called "ibdata1" should be there. Copy the. On your new server in the data folder, there is also an "ibdata1" file. Rename it to "ibdata.Bak" then paste the "ibdata1" that was previously copied from the old server. Finally, restart WAMP services. Then go to Phpmyadmin and check that your databases have been restored successfully!

1

In relational databases is used a resource for data security which is the log with it Mysql in case saves all queries except those of SELECT in the log file then you will have there all the Sqls to recover your database.

to know where the log file is enter in your configuration file "my.cfn" or search the internet for the default folder.

here is some information: https://stackoverflow.com/questions/5441972/how-to-see-log-files-in-mysql

Other than that, I’m sorry but it’s relatively impossible.

-1

Do the following install Mysql Front, to make it easy to manipulate and configure the entries to access. This is usually the case: Configuração Inicial

Then after connecting just export your Database to the . sql extension

See below:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.