Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MYSQL .ibd file data recovery

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Restore the .ibd file in mysql.

1. You need to create the same database table structure first

2. Delete tablespace

ALTER TABLE "+ dbName+" DISCARD TABLESPACE

3. Copy the xxxxx.ibd file to the database directory

4. Restore the imported tablespace

ALTER TABLE "+ dbName+" IMPORT TABLESPACE

-restore the frm table structure-'remember: be sure to operate sequentially, otherwise the library will die. You have to reinstall it and do it again.'-

1. Create the same table name in the normal mysql service, with one field at will, and the table name must be exactly the same as .frm.

Create table app_info (id int)

2. Add to stop database service my.ini

[mysqld]

Innodb_force_recovery=6

3. Physically cover * .frm

4. Start service execution

Desc app_info reported an error and found the real number of columns in the .err file (7 columns can be seen in my case)

5. Stop the service, remove the innodb_force_recovery=6 in my.ini, start the service again, and delete the data table.

Create a corresponding column table after deletion

Create table app_info (id1 int,id2 int,id3 int,id4 int,id5 int,id6 int,id7 int)

6. Repeat steps 2 and 3

After the service starts, you can see the complete table structure by executing desc.

Then right-click "object Information" in the table to see DLL

7. Stop the service again, remove the innodb_force_recovery=6 in my.ini, start the service again, delete the data table, and specify the obtained real dll to restore the table structure.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report