我用innobackupex 备份文件后,然后用innobackupex 还原,先--apply-log  然后--copy-back,在还原前 先停止数据库,然后把 当前datadir里面东西都给删除。
但是在启动的时候居然报这样错误。我把ib_文件都删除, rm -rf ib_logfile* && rm -rf mysql-bin.*  还是不起作用,
这个是不是日志文件造成的,但是我的2个机器配置都是一样的,从A备份数据,然后到B还原,A B只是端口和数据库目录不一样,其他基本都是一致的。然后我测试了一下把ibdata1 这个文件给删除,数据库可以正常启动,但是有个问题,却找不到表结构。显然问题就出在ibdata1文件上 但是这个文件不能删除。否则 .frm .ibd 就识别不了,这个启动是什么错误?大家看看111018 17:20:47 mysqld_safe Starting mysqld daemon with databases from /data/mysql/data3307
111018 17:20:47 [Note] Plugin 'FEDERATED' is disabled.
111018 17:20:48  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 256 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200
111018 17:20:49  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 256 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200
111018 17:20:51  InnoDB: Log file ./ib_logfile2 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile2 size to 256 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200
InnoDB: Cannot initialize created log files because
InnoDB: data files are corrupt, or new data files were
InnoDB: created when the database was started previous
InnoDB: time but the database was not shut down
InnoDB: normally after that.
111018 17:20:52 [ERROR] Plugin 'InnoDB' init function returned error.
111018 17:20:52 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
111018 17:20:52 [ERROR] Unknown/unsupported table type: INNODB
111018 17:20:52 [ERROR] Aborting111018 17:20:52 [Warning] Forcing shutdown of 1 plugins
111018 17:20:52 [Note] /usr/local/mysql3307/bin/mysqld: Shutdown complete111018 17:20:52 mysqld_safe mysqld from pid file /data/mysql/data3307/szgeobetadb2.morningstar.com.pid ended

解决方案 »

  1.   

    对了,在my.cnf 里面配置了default-storage-engine=InnoDB
      

  2.   

    mysql> select version();
    +------------+
    | version()  |
    +------------+
    | 5.1.39-log |
      

  3.   

    当我把 default-storage-engine=InnoDB
    改成 MyISAM
    数据库可以启动了,但是不支持Innodb
    mysql> show engines;
    +------------+---------+----------------------------------------------------------------+--------------+------+------------+
    | Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
    +------------+---------+----------------------------------------------------------------+--------------+------+------------+
    | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |
    | MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
    | BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
    | CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |
    | MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
    | FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
    | ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |
    +------------+---------+----------------------------------------------------------------+--------------+------+------------+但是发现原来备份都是Innodb的,现在读不了,而且