MySQL 4.1 が「データベースが正常にシャットダウンされませんでした」というメッセージでクラッシュします。

MySQL 4.1 が「データベースが正常にシャットダウンされませんでした」というメッセージでクラッシュします。

時々、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

これらのメッセージは特定の問題を指摘しているわけではありません。クラッシュの原因を突き止めるにはどうすればいいでしょうか?

答え1

  1. データベースを停止する

  2. データベースをダンプ(またはバックアップ)します。

  3. data(Windows) または /var(UNIX) ディレクトリ内のすべてを削除します。

  4. dbを再起動します(これでdbが起動します)

  5. mysqlディレクトリを復元します。

  6. dbを停止

  7. 他のデータベースとテーブルを復元する

  8. dbを起動

答え2

innodb_force_recovery=2設定を行って MySQL ダンプを実行し、元のデータベース ディレクトリを削除して、インポートを使用して再作成する必要があると思います。この記事より詳細な手順があります。

関連情報