当mysql服务器无法启动时恢复MySQL数据库

我的Windows Server 2003昨天下午失去了电力。 将服务器备份后,MySQL 5.0数据库将无法启动。 我检查了错误日志,发现访问ibdata1文件中的页面时出错。 还有一个断言失败,表明我需要启用innodb_force_recovery。 我试过,并将值设置为4,5,6和8.每次mysql服务器将无法启动。 我在这里看到innodb工具,但似乎我需要至less一个部分function的mysql实例为那些工作。

我需要至less从表中恢复数据。 最近的备份不包含我需要恢复的所有内容。 到目前为止,我所看到的一切都表明我运气不佳。 我想我会看看有没有人能指出我正确的方向。

这里是相关的错误日志条目:

InnoDB: The user has set SRV_FORCE_NO_LOG_REDO on InnoDB: Skipping log redo InnoDB: Error: trying to access page number 4294965119 in space 0, InnoDB: space name .\ibdata1, InnoDB: which is outside the tablespace bounds. InnoDB: Byte offset 0, len 16384, i/o type 10. InnoDB: If you get this error at mysqld startup, please check that InnoDB: your my.cnf matches the ibdata files that you have in the InnoDB: MySQL server. 091015 18:46:22InnoDB: Assertion failure in thread 4648 in file .\fil\fil0fil.c line 3959 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html InnoDB: about forcing recovery. 091015 18:46:22 [ERROR] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Got signal 11. Aborting! 091015 18:46:22 [ERROR] Aborting 091015 18:46:22 [Note] C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt: Shutdown complete 

configuration文件:

 [client] port=3306 [mysql] default-character-set=latin1 [mysqld] innodb_force_recovery = 8 port=3306 basedir="C:/Program Files/MySQL/MySQL Server 5.0/" datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/" default-character-set=latin1 default-storage-engine=INNODB sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" max_connections=100 query_cache_size=0 table_cache=256 tmp_table_size=103M thread_cache_size=8 #*** MyISAM Specific options myisam_max_sort_file_size=100G myisam_max_extra_sort_file_size=100G myisam_sort_buffer_size=205M key_buffer_size=175M read_buffer_size=64K read_rnd_buffer_size=256K sort_buffer_size=256K #*** INNODB Specific options *** innodb_additional_mem_pool_size=7M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=3498K innodb_buffer_pool_size=339M innodb_log_file_size=170M innodb_thread_concurrency=8 

看看http://bugs.mysql.com/bug.php?id=16827 。 这听起来很像你的错误。 在这种情况下的根本原因是configuration的意外改变。 如果你有你的configuration文件的备份,你可以比较它与当前的。

如果您不确定要查找什么内容,请发布您的my.cnf的副本以及mysql数据目录中的文件列表。