关于innodb_force_recovery

MySql 码拜 8年前 (2016-02-04) 2138次浏览
将主库的数据文件全部拷贝到从库,用从库的配置文件启动,差别不是很大,主库是分表,别的貌似没啥差别,但是InnoDb报错,
InnoDB: Error: tablespace size stored in header is 128640 pages, but
InnoDB: the sum of data file sizes is only 128000 pages
InnoDB: Cannot start InnoDB. The tail of the system tablespace is
InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an
InnoDB: inappropriate way, removing ibdata files from there?
InnoDB: You can set innodb_force_recovery=1 in my.cnf to force
InnoDB: a startup if you are trying to recover a badly corrupt database.
141103 15:21:05 [ERROR] Plugin “InnoDB” init function returned error.
141103 15:21:05 [ERROR] Plugin “InnoDB” registration as a STORAGE ENGINE failed.
141103 15:21:05 [Note] Event Scheduler: Loaded 2 events
本人在my.cnf中加上了这个配置,但是数据库不能create index ,显示ERROR 1030 (HY000): Got error -1 from storage engine
error-log:
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_… is removed.
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_… is removed.
解决方案

2

是正常停机拷贝的吗

7

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

3

q!m

8

从错误来看说的是你拷贝前后的数据文件大小不一致啊。

InnoDB: Error: tablespace size stored in header is 128640 pages, but
InnoDB: the sum of data file sizes is only 128000 pages

这个帖子最后本人解决了问题,也列举了解决方法,你看一下对你能否有帮助
http://bbs.csdn.net/topics/390966560


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明关于innodb_force_recovery
喜欢 (0)
[1034331897@qq.com]
分享 (0)