昨天公司突然停电,服务器重启时,myssql 1067 服务启动不了。
花了整整一天的时间,终于把数据给挽救回来了。~立即发博,避免再出现受害人:
mysql正在做处理的时候,突然停电,异常中断。
再启动mysql服务的时候报错,
--------------------------------
错误1067 进程意外中止
-------------------------------
晚上常规的修改my.ini 方法,不起作用。
这时间进入Data目录下查看err日志文件,当时日志如下:
110102 11:43:19 [Note] mysqld: Shutdown complete
110102 11:45:37 [Note] Plugin 'FEDERATED' is disabled.
C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqld: Table 'mysql.plugin' doesn't exist
110102 11:45:37 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: Error: log file ./ib_logfile0 is of different size 0 177209344 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
110102 11:45:37 [ERROR] Plugin 'InnoDB' init function returned error.
110102 11:45:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
110102 11:45:37 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
110102 11:43:19 [Note] mysqld: Shutdown complete
110102 11:45:37 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: than specified in the .cnf file 0 5242880 bytes!
InnoDB: Error: log file ./ib_logfile0 is of different size 0 177209344 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
110102 11:45:37 [ERROR] Plugin 'InnoDB' init function returned error.
110102 11:45:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
110102 11:45:37 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
异常信息变了,说明mysql.plugin已经找到了。但是ib_logfile 文件和Data目录下的ibdata1已经损坏,无法启动。MYSQL服务
如果这时间有备份,用备份文件覆盖即可运行。
另:如果没有备份,则需要删除ib_logfile0 ,ib_logfile1,ibdata1 ,再启动MYSQL就行了。
但是删除ibdata1 ,数据库表结构还在,但是表结构里面的数据找查不到了。
找到系统目录的MySQL Datafiles文件夹,然后再修改my.ini配置文件,加上
#*** INNODB Specific options ***
innodb_data_home_dir="X:/MySQL Datafiles/"
再打开数据库,打开表结构,数据都回来了吧!