【问题标题】:MySql service won't start from recovered ibdata1 fileMySql 服务不会从恢复的 ibdata1 文件启动
【发布时间】:2019-07-17 08:26:23
【问题描述】:

我们的一台服务器遭到来自一群国际黑客的勒索软件攻击。所以我们重新分组并重新开始,唯一不受影响的数据是存储在 mysql 程序数据文件夹中的 ibdata1 文件。

我们想在新实例上恢复该数据,以便我们继续我们的操作,但在尝试运行新安装的 mysql 后,服务停止并出现错误 1067。它建议删除 InnoDB 创建的所有文件:全部ibdata 文件和所有 ib_logfile 文件。如果我这样做,服务将运行,但我不能这样做,因为我需要访问这个特定数据文件中的数据。我还在我的 .cnf 文件中添加了这两行

innodb_force_recovery=6
innodb_fast_shutdown=0

这没有奏效。所以我只删除了日志文件,它创建了新的日志文件,随之而来的是这个错误

190223 11:38:48 [Note] Plugin 'FEDERATED' is disabled.
190223 11:38:48 InnoDB: The InnoDB memory heap is disabled
190223 11:38:48 InnoDB: Mutexes and rw_locks use Windows interlocked functions
190223 11:38:48 InnoDB: Compressed tables use zlib 1.2.3
190223 11:38:48 InnoDB: Initializing buffer pool, size = 2.0G
190223 11:38:48 InnoDB: Completed initialization of buffer pool
190223 11:38:48 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
190223 11:38:48 [ERROR] Plugin 'InnoDB' init function returned error.
190223 11:38:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
190223 11:38:48 [ERROR] Unknown/unsupported storage engine: INNODB
190223 11:38:48 [ERROR] Aborting

Then I replaced the log files with the same ones I used with the original ibdata1 file then I got this error.

190223 12:11:26 [Note] Plugin 'FEDERATED' is disabled.
190223 12:11:26 InnoDB: The InnoDB memory heap is disabled
190223 12:11:26 InnoDB: Mutexes and rw_locks use Windows interlocked functions
190223 12:11:26 InnoDB: Compressed tables use zlib 1.2.3
190223 12:11:26 InnoDB: Initializing buffer pool, size = 2.0G
190223 12:11:26 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 1073741824 bytes
InnoDB: than specified in the .cnf file 0 224395264 bytes!
190223 12:11:26 [ERROR] Plugin 'InnoDB' init function returned error.
190223 12:11:26 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
190223 12:11:26 [ERROR] Unknown/unsupported storage engine: INNODB
190223 12:11:26 [ERROR] Aborting

日志文件中似乎有一个检查点,这是 mysql 服务正确读取数据文件所必需的。也许我需要在 my.ini 配置文件中指定日志文件的大小。但我不知道该怎么做。

任何帮助都会在这里派上用场。

【问题讨论】:

    标签: mysql database innodb data-recovery mysql-error-1067


    【解决方案1】:

    在您的 my.ini(或 my.cnf)文件中,添加(或替换)以下行:

    innodb_log_file_size = 1024M
    

    详情请见https://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_log_file_size

    【讨论】:

    • 感谢 schtever。我尝试添加该位,但每次启动服务时文件的大小都会更改,因此我将其注释掉。现在它向我显示了这个错误190225 7:34:39 InnoDB: Error: data file .\ibdata1 uses page size 2048, 190225 7:34:39 InnoDB: but the only supported page size in this release is=16384.我该如何解决这个冲突?
    • 从上面的 cmets 看来,您使用的是 MySQL 5.5。在该版本中,您无法设置 innodb 页面大小。看起来您在被黑客入侵时正在运行旧版本?要从您已经拥有的 ibdata1 文件中检索数据,我会调出您在其下创建它的同一版本,转储数据库,然后在 MySQL 5.5 下加载它。
    猜你喜欢
    • 2018-05-11
    • 2018-05-22
    • 2013-02-24
    • 1970-01-01
    • 2018-03-06
    • 2010-11-24
    • 2011-11-26
    • 1970-01-01
    相关资源
    最近更新 更多