Mysql ibd File Recovery Guide

Source: Internet
Author: User
Tags compact dba mysql in

Background

MySQL in the process of use, inevitably encountered database table error operation, based on this, the author pro-Pro, the MySQL data table ibd File Recovery To do the following detailed description of the development or the primary DBA to provide some guidance, if there are related issues in the blog, please specify, mutual learning and common progress.

Recovery instructions
  1. Create DATABASE (create it YYGK)
  2. Create a data table

    Note: Row_format to be consistent with the Row_format of IBD files, otherwise it will prompt for inconsistencies. Current Row_format=dynamic
  3. Properties of the Table view
    We use: Show table status like ' T_dict ' \g, view the properties of the table as follows.

    Note: Careful we found that the creation of the table when the Row_format and table properties of the inconsistency, based on InnoDB is, to set the Row_format to dynamic, you need to modify the global configuration of MySQL, directly in the MYQL command to modify: Set global Innodb_file_format=barracuda;
  4. Table error Message View

    From the error log we found that: Row_format Setup failed, follow the instructions in table 3rd, modify it in the MYQL command: Set global Innodb_file_format=barracuda, and then recreate the table.
  5. Description
    When we restore the table, to ensure the consistency of Row_format and IBD files, if the IBD file is compact, the need to build a table, set to Row_format=compact, when the recovery, self-solve, starting from the 6th step, focus on how to recover.
  6. Restore first step: Remove table space
    ALTER TABLE t_dict DISCARD tablespace;
  7. Recovery Step Two: Put the backed-up IBD file into the database name-> created by mysql->data->, and copy ibd to this directory, as shown in
  8. Recovery Step Three: Re-importing table spaces
    ALTER TABLE t_dict IMPORT tablespace;
  9. Postscript
    When we finish to the previous step, we find that the data in the database has been fully recovered. Praise. Praise. I would like to learn more about MySQL in the future, master the DBA's skills and apply it to project development. End!!!!

Mysql ibd File Recovery Guide

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.