从 ibdata1 恢复未连接的表

发布于 2024-12-06 11:51:41 字数 417 浏览 6 评论 0原文

我遇到mysql数据丢失的情况,步骤如下:

1.我将Table_A从MyISAM转换为InnoDB(innodb_file_per_table关闭),看到ibdata1大小增加;

2.开启innodb_file_per_table;

3.将Table_A转换回MyISAM,ibdata1没有收缩;

4.将Table_A转换为InnoDB,得到Table_A.ibd文件;

现在我丢失了 Table_A.ibd 文件,并且想从 ibdata1 文件中查找数据。

我关闭 innodb_file_per_table 并尝试使用 InnoDB 格式创建相同的 Table_A,但失败了,并告诉我 TABLE_A 已经存在,并且我无法从架构中找到该表。

我搜索了整个互联网,没有找到任何有用的信息,请帮忙!

I'm encountering data loss of mysql, below is the steps:

1.I converted Table_A from MyISAM to InnoDB (with innodb_file_per_table OFF), saw the ibdata1 size increased;

2.Turned ON innodb_file_per_table;

3.Converted Table_A to MyISAM back, ibdata1 didn't shrink;

4.Converted Table_A to InnoDB, got Table_A.ibd file;

Now I lost the Table_A.ibd file, and want to find data back from the ibdata1 file.

I turn OFF innodb_file_per_table and tried to create the same Table_A with InnoDB format, it fails, and tell me that TABLE_A already exists, and I can't find the table from the schema.

I've searched whole internet and didn't find anything helpful, please help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

药祭#氼 2024-12-13 11:51:41

Goodle Percona 数据恢复工具包。
您需要:

  1. 将 ibdata1 拆分为页面(page_parser)
  2. 从 InnoDB 字典 - 表 SYS_TABLES 和 SYS_INDEXES 中获取记录
  3. 从 SYS_* 表中查找表的 index_id
  4. 从具有表的 index_id 的页面中获取记录(constraints_parser 工具)。

更新:数据恢复工具包已移至 GitHub

Goodle Percona data recovery toolkit.
You need to:

  1. Split ibdata1 into pages (page_parser)
  2. Fetch records from InnoDB dictionary - tables SYS_TABLES and SYS_INDEXES
  3. Find index_id of your table from SYS_* tables
  4. Fetch records from pages with index_id of your table (constraints_parser tool).

UPDATE: Data recovery toolkit moved to GitHub

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文