有时,我的MySQL 4.1 Windows服务崩溃在日志中的以下几行:
091218 9:31:25 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 091218 9:31:33 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 2 817025450. InnoDB: Doing recovery: scanned up to log sequence number 2 817025450 091218 9:31:35 InnoDB: Flushing modified pages from the buffer pool... 091218 9:31:35 InnoDB: Started; log sequence number 2 817025450 C:\Programme\MySQL\MySQL Server 4.1\bin\mysqld-nt: ready for connections. Version: '4.1.14-nt' socket: '' port: 3306 Official MySQL binary 100107 9:02:51 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 100107 9:02:53 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 2 953338420. InnoDB: Doing recovery: scanned up to log sequence number 2 953338420 100107 9:02:53 InnoDB: Flushing modified pages from the buffer pool... 100107 9:02:53 InnoDB: Started; log sequence number 2 953338420 C:\Programme\MySQL\MySQL Server 4.1\bin\mysqld-nt: ready for connections. Version: '4.1.14-nt' socket: '' port: 3306 Official MySQL binary
这些消息并没有指出任何具体问题。 我能做些什么来追踪崩溃的起因?
停止数据库
转储(或备份)您的数据库。
删除数据(Windows)或/ var(UNIX)目录中的所有内容。
重新启动数据库(现在数据库将启动)
恢复mysql目录。
停止分贝
恢复其他数据库和表
启动分贝
我相信你需要设置innodb_force_recovery=2设置并做一个mysql转储,删除原来的数据库目录并使用导入重新创build它。 本文有更详细的步骤。