ibdata 数据如何恢复通过 ibdata1 ib

15173人阅读
MySQL(11)
1. 环境说明
RHEL 6.4 x86_64 + MySQL 5.5.37和MySQL 5.6.19
blog地址:
2. 案例:redo log文件(ib_logfile)大小参数被修改:innodb_log_file_size
innodb_log_file_size = 256M &-- 修改为200M
版本是5.5的,启动失败,会出现如下错误:
InnoDB: Error: log file ./ib_logfile0 is of different size 0
## 原来redo log的大小
InnoDB: than specified in the .cnf file 0
## redo log被修改的大小
:01:12 [ERROR] Plugin 'InnoDB' init function returned error.
:01:12 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
:01:12 [ERROR] Unknown/unsupported storage engine: InnoDB
:01:12 [ERROR] Aborting
版本是5.6.16之后的,正常启动,会自动将原来的redo log删除,然后重新生成新的redo log(这个比较重要):
21:57:05 1093 [Warning] InnoDB: Resizing redo log from 2*16384 to 2*12800 pages, LSN=
21:57:05 1093 [Warning] InnoDB: Starting to delete and rewrite log files.
## 删除原redo log
21:57:05 1093 [Note] InnoDB: Setting log file ./ib_logfile101 size to 200 MB
InnoDB: Progress in MB: 100 200
21:57:06 1093 [Note] InnoDB: Setting log file ./ib_logfile1 size to 200 MB
InnoDB: Progress in MB: 100 200
21:57:07 1093 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
21:57:07 1093 [Warning] InnoDB: New log files created, LSN=
## 新redo log重建完毕
原redo log大小:16384*16(page的大小为16k)/MB
新redo log大小:4=200MB
3. 案例:ibdata1文件大小参数被修改:innodb_data_file_path
(1)ibdata1从大改小
innodb_data_file_path = ibdata1:1G:autoextend &-- 修改为:ibdata1:300M:autoextend
在版本是5.5和5.6中,启动正常,并且日志中没有任何异常。但是如果将autoextend去掉,就会报错,启动失败,如:[版本:5.5.37]
InnoDB: Error: data file ./ibdata1 is of a different size
InnoDB: 65536 pages (rounded down to MB)
InnoDB: than specified in the .cnf file 19200 pages!
:51:53 InnoDB: Could not open or create data files.
:51:53 InnoDB: If you tried to add new data files, and it failed here,
:51:53 InnoDB: you should now edit innodb_data_file_path f back
:51:53 InnoDB: to what it was, and remove the new ibdata files InnoDB created
:51:53 InnoDB: in this failed attempt. InnoDB only wrote those files full of
:51:53 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
:51:53 InnoDB: remove old data files which contain your precious data!
:51:53 [ERROR] Plugin 'InnoDB' init function returned error.
:51:53 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
:51:53 [ERROR] Unknown/unsupported storage engine: InnoDB
:51:53 [ERROR] Aborting
原来的ibdata1大小为:4=1024M=1G
当前ibdata1被修改为:4=300M
(2)ibdata1值小改大
innodb_data_file_path = ibdata1:1G:autoextend &-- 修改为:ibdata1:1200M:autoextend
那么会在启动时出现如下错误:
*****在5.5版本中:[版本:5.5.37]
InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
InnoDB: 65536 pages (rounded down to MB) than specified in the .cnf file:
InnoDB: initial 76800 pages, max 0 (relevant if non-zero) pages!
:57:43 InnoDB: Could not open or create data files.
:57:43 InnoDB: If you tried to add new data files, and it failed here,
:57:43 InnoDB: you should now edit innodb_data_file_path f back
:57:43 InnoDB: to what it was, and remove the new ibdata files InnoDB created
:57:43 InnoDB: in this failed attempt. InnoDB only wrote those files full of
:57:43 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
:57:43 InnoDB: remove old data files which contain your precious data!
:57:43 [ERROR] Plugin 'InnoDB' init function returned error.
:57:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
:57:43 [ERROR] Unknown/unsupported storage engine: InnoDB
:57:43 [ERROR] Aborting
*****在5.6版本中:[版本:5.6.19]
22:20:01 1222 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 65536 pages (rounded down to MB) than
specified in the .cnf file: initial 76800 pages, max 0 (relevant if non-zero) pages!
22:20:01 1222 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the syste
m tablespace, and it failed here, you should now edit innodb_data_file_path f back to what it was, and remove the new ibdata fil
es InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be caref
ul: do not remove old data files which contain your precious data!
22:20:01 1222 [ERROR] Plugin 'InnoDB' init function returned error.
22:20:01 1222 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
22:20:01 1222 [ERROR] Unknown/unsupported storage engine: InnoDB
22:20:01 1222 [ERROR] Aborting
原来的ibdata1大小为:4=1024M=1G
当前ibdata1被修改为:4=1200M
blog地址:
-- Bosco &QQ:
---- END ----
-------------------------------------------------------------------------------------------------------
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:251933次
积分:2957
积分:2957
排名:第11719名
原创:63篇
评论:22条
(1)(1)(1)(4)(6)(5)(8)(3)(1)(4)(2)(6)(23)鎵?竴鎵?紝璁块棶寰?ぞ鍖

我要回帖

更多关于 如何选择ib课程 的文章

 

随机推荐