gpt4 book ai didi

mysql - 从 .frm(无 .myd 和 .myi、ibdada、my.ini)文件中恢复 MySQL InnoDB 数据/结构

转载 作者:太空宇宙 更新时间:2023-11-03 10:51:41 24 4
gpt4 key购买 nike

我试图从复制自 innodb 定义表的文件夹中恢复我的旧 innodb 数据库。目前没有二进制日志文件和my.ini文件。我手边没有 ibdata 日志文件。我只需要能够重新读取表格信息,这样我就可以重新制作那些丢失的表格。

我也会失去外键关系。

如何恢复数据进入不可用日志文件的此类表的结构?

当我尝试访问此类表时,一些有用的错误消息是:

1. Can't find file: 'college_users' (errno: 2 - No such file or directory)
2. Table 'college.college_batches' doesn't exist

最佳答案

有一个名为 dbsake 的程序,它有一个名为 frmdump 的命令。

Decode a MySQL .frm file and output a CREATE VIEW or CREATE TABLE statement.

This command does not require a MySQL server and interprets a .frm file according to rules similar to the MySQL server.

For more information on how this command works see Description of the .frm format

例子:

$ dbsake frmdump --type-codes /var/lib/mysql/mysql/plugin.frm
--
-- Table structure for table `plugin`
-- Created with MySQL Version 5.5.35
--

CREATE TABLE `plugin` (
`name` varchar(64) NOT NULL DEFAULT '' /* MYSQL_TYPE_VARCHAR */,
`dl` varchar(128) NOT NULL DEFAULT '' /* MYSQL_TYPE_VARCHAR */,
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins';

更多详情:https://dbsake.readthedocs.io/en/latest/commands/frmdump.html

关于mysql - 从 .frm(无 .myd 和 .myi、ibdada、my.ini)文件中恢复 MySQL InnoDB 数据/结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24374426/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com