msyql innodb表损坏,数据库无法启动

来源:互联网 发布:广州丽晶软件 编辑:程序博客网 时间:2024/04/25 13:15

以下是mysql启动日志信息,启动后,自动停止

130420 11:43:57 [Note] Plugin 'FEDERATED' is disabled.

130420 11:43:57 InnoDB: The InnoDB memory heap is disabled
130420 11:43:58 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130420 11:43:58 InnoDB: Compressed tables use zlib 1.2.3
130420 11:43:58 InnoDB: Initializing buffer pool, size = 18.0M
130420 11:43:58 InnoDB: Completed initialization of buffer pool
130420 11:43:58 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 2574525768534
130420 11:43:58  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...
InnoDB: Doing recovery: scanned up to log sequence number 2574526080967
130420 11:43:59  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 
InnoDB: Apply batch completed
130420 11:43:59  InnoDB: Waiting for the background threads to start
130420 11:44:00 InnoDB: 1.1.8 started; log sequence number 2574526080967
130420 11:44:00 [Note] Event Scheduler: Loaded 7 events
130420 11:44:00 [Note] Event Scheduler: scheduler thread started with id 1
130420 11:44:00 [Note] C:\Program Files (x86)\gServer\mysql\bin\gpsmysqld.exe: ready for connections.

Version: '5.5.23'  socket: ''  port: 3311  MySQL Community Server (GPL)


这个属于页损坏,你只能设置innodb_force_recovery并尝试启动MySQL。这样的话会丢一部分数据。MySQL启动以后你需要把数据导出来,如果只有这个表有损坏,那么这个表的数据都需要重新导入,如果只是索引的问题,必须要重建这个索引。

http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html

 

导致这个问题的原因有很多,正常的话,innodb_doublewrite打开的话这种页损坏的概率会小的多

解决方法:在my.ini添加

[mysqld]innodb_force_recovery = 4
参照:http://www.askhellodba.com/index.php?qa=147&qa_1=innodb%E8%A1%A8%E6%8D%9F%E5%9D%8F%EF%BC%8C%E6%95%B0%E6%8D%AE%E5%BA%93%E6%97%A0%E6%B3%95%E5%90%AF%E5%8A%A8