我的 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
这些消息没有指向任何具体问题。我可以做些什么来追踪崩溃的根源?
我相信您需要设置
innodb_force_recovery=2
设置并执行 mysql 转储,删除原始数据库目录并使用导入重新创建它。本文有更详细的步骤。停止数据库
转储(或备份)您的数据库。
删除 data(windows) 或 /var(UNIX) 目录中的所有内容。
重新启动数据库(现在数据库将启动)
恢复mysql目录。
停止数据库
恢复其他数据库和表
启动数据库