我如何恢复 mysql 5.5 数据库?

我如何恢复 mysql 5.5 数据库?

我正在尝试恢复 mysql 数据库,但没有成功。

我在 user.err 文件中收到的错误消息

190709 12:28:14 [Note] Plugin 'FEDERATED' is disabled.
190709 12:28:14 InnoDB: The InnoDB memory heap is disabled
190709 12:28:14 InnoDB: Mutexes and rw_locks use Windows interlocked functions
190709 12:28:14 InnoDB: Compressed tables use zlib 1.2.3
190709 12:28:14 InnoDB: Initializing buffer pool, size = 128.0M
190709 12:28:14 InnoDB: Completed initialization of buffer pool
InnoDB: Error: auto-extending data file .\ibdata1 is of a different size
InnoDB: 64 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
190709 12:28:14 InnoDB: Could not open or create data files.
190709 12:28:14 InnoDB: If you tried to add new data files, and it failed here,
190709 12:28:14 InnoDB: you should now edit innodb_data_file_path in my.cnf back
190709 12:28:14 InnoDB: to what it was, and remove the new ibdata files InnoDB created
190709 12:28:14 InnoDB: in this failed attempt. InnoDB only wrote those files full of
190709 12:28:14 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
190709 12:28:14 InnoDB: remove old data files which contain your precious data!
190709 12:28:14 [ERROR] Plugin 'InnoDB' init function returned error.
190709 12:28:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
190709 12:28:14 [ERROR] Unknown/unsupported storage engine: INNODB
190709 12:28:14 [ERROR] Aborting

我尝试过

  1. 在另一台计算机上安装了 mysql,路径与崩溃的数据库相同
  2. 创建了一个与旧数据库同名的空数据库。
  3. 在新电脑上停止 mysql 服务
  4. 在新电脑上备份文件 mysql/data
  5. 将旧文件 ib_logfile0、ib_logfile1 和 ibdata1 复制到新计算机 mysql/data 目录
  6. 在新电脑上启动 mysql

我收到错误信息

崩溃错误消息

答案1

检查 ibdata1 文件的当前大小,或者更好的方法是检查旧机器上的 my.cnf,并在新机器上的 my.cnf 中设置参数 innodb_data_file_path 以匹配 ibdata1 大小/旧配置

相关内容