mysql innodb ibdata ib_logfile_MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL

2023-10-22 19:10

本文主要是介绍mysql innodb ibdata ib_logfile_MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1. 环境说明

RHEL 6.4 x86_64 + MySQL 5.5.37和MySQL 5.6.19

blog地址:http://blog.csdn.net/hw_libo/article/details/39215723

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 268435456 bytes ## 原来redo log的大小

InnoDB: than specified in the .cnf file 0 209715200 bytes! ## redo log被修改的大小

140912 0:01:12 [ERROR] Plugin 'InnoDB' init function returned error.

140912 0:01:12 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140912 0:01:12 [ERROR] Unknown/unsupported storage engine: InnoDB

140912 0:01:12 [ERROR] Aborting

版本是5.6.16之后的,正常启动,会自动将原来的redo log删除,然后重新生成新的redo log(这个比较重要):

2014-09-11 21:57:05 1093 [Warning] InnoDB: Resizing redo log from 2*16384 to 2*12800 pages, LSN=71249171

2014-09-11 21:57:05 1093 [Warning] InnoDB: Starting to delete and rewrite log files. ## 删除原redo log

2014-09-11 21:57:05 1093 [Note] InnoDB: Setting log file ./ib_logfile101 size to 200 MB

InnoDB: Progress in MB: 100 200

2014-09-11 21:57:06 1093 [Note] InnoDB: Setting log file ./ib_logfile1 size to 200 MB

InnoDB: Progress in MB: 100 200

2014-09-11 21:57:07 1093 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0

2014-09-11 21:57:07 1093 [Warning] InnoDB: New log files created, LSN=71249171 ## 新redo log重建完毕

原redo log大小:2*16384*8(page的大小为8k)/1024=256MB

新redo log大小:2*12800*8/1024=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!

140911 23:51:53 InnoDB: Could not open or create data files.

140911 23:51:53 InnoDB: If you tried to add new data files, and it failed here,

140911 23:51:53 InnoDB: you should now edit innodb_data_file_path in my.cnf back

140911 23:51:53 InnoDB: to what it was, and remove the new ibdata files InnoDB created

140911 23:51:53 InnoDB: in this failed attempt. InnoDB only wrote those files full of

140911 23:51:53 InnoDB: zeros, but did not yet use them in any way. But be careful: do not

140911 23:51:53 InnoDB: remove old data files which contain your precious data!

140911 23:51:53 [ERROR] Plugin 'InnoDB' init function returned error.

140911 23:51:53 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140911 23:51:53 [ERROR] Unknown/unsupported storage engine: InnoDB

140911 23:51:53 [ERROR] Aborting

原来的ibdata1大小为:65536*8*2/1024=1024M=1G

当前ibdata1被修改为:19200*8*2/1024=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!

140911 23:57:43 InnoDB: Could not open or create data files.

140911 23:57:43 InnoDB: If you tried to add new data files, and it failed here,

140911 23:57:43 InnoDB: you should now edit innodb_data_file_path in my.cnf back

140911 23:57:43 InnoDB: to what it was, and remove the new ibdata files InnoDB created

140911 23:57:43 InnoDB: in this failed attempt. InnoDB only wrote those files full of

140911 23:57:43 InnoDB: zeros, but did not yet use them in any way. But be careful: do not

140911 23:57:43 InnoDB: remove old data files which contain your precious data!

140911 23:57:43 [ERROR] Plugin 'InnoDB' init function returned error.

140911 23:57:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140911 23:57:43 [ERROR] Unknown/unsupported storage engine: InnoDB

140911 23:57:43 [ERROR] Aborting

*****在5.6版本中:[版本:5.6.19]

2014-09-11 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!

2014-09-11 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 in my.cnf 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!

2014-09-11 22:20:01 1222 [ERROR] Plugin 'InnoDB' init function returned error.

2014-09-11 22:20:01 1222 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2014-09-11 22:20:01 1222 [ERROR] Unknown/unsupported storage engine: InnoDB

2014-09-11 22:20:01 1222 [ERROR] Aborting

原来的ibdata1大小为:65536*8*2/1024=1024M=1G

当前ibdata1被修改为:76800*8*2/1024=1200M

blog地址:http://blog.csdn.net/hw_libo/article/details/39215723

-- Bosco QQ:375612082

---- END ----

-------------------------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

f68f2add0b68e4f9810432fce46917b7.png

相关标签:大小 参数

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

这篇关于mysql innodb ibdata ib_logfile_MySQL中ib_logfile和ibdata1参数大小被修改后_MySQL的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/263098

相关文章

SQL Server修改数据库名及物理数据文件名操作步骤

《SQLServer修改数据库名及物理数据文件名操作步骤》在SQLServer中重命名数据库是一个常见的操作,但需要确保用户具有足够的权限来执行此操作,:本文主要介绍SQLServer修改数据... 目录一、背景介绍二、操作步骤2.1 设置为单用户模式(断开连接)2.2 修改数据库名称2.3 查找逻辑文件名

SQL Server数据库死锁处理超详细攻略

《SQLServer数据库死锁处理超详细攻略》SQLServer作为主流数据库管理系统,在高并发场景下可能面临死锁问题,影响系统性能和稳定性,这篇文章主要给大家介绍了关于SQLServer数据库死... 目录一、引言二、查询 Sqlserver 中造成死锁的 SPID三、用内置函数查询执行信息1. sp_w

canal实现mysql数据同步的详细过程

《canal实现mysql数据同步的详细过程》:本文主要介绍canal实现mysql数据同步的详细过程,本文通过实例图文相结合给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的... 目录1、canal下载2、mysql同步用户创建和授权3、canal admin安装和启动4、canal

SQL中JOIN操作的条件使用总结与实践

《SQL中JOIN操作的条件使用总结与实践》在SQL查询中,JOIN操作是多表关联的核心工具,本文将从原理,场景和最佳实践三个方面总结JOIN条件的使用规则,希望可以帮助开发者精准控制查询逻辑... 目录一、ON与WHERE的本质区别二、场景化条件使用规则三、最佳实践建议1.优先使用ON条件2.WHERE用

MySQL存储过程之循环遍历查询的结果集详解

《MySQL存储过程之循环遍历查询的结果集详解》:本文主要介绍MySQL存储过程之循环遍历查询的结果集,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录前言1. 表结构2. 存储过程3. 关于存储过程的SQL补充总结前言近来碰到这样一个问题:在生产上导入的数据发现

MySQL 衍生表(Derived Tables)的使用

《MySQL衍生表(DerivedTables)的使用》本文主要介绍了MySQL衍生表(DerivedTables)的使用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学... 目录一、衍生表简介1.1 衍生表基本用法1.2 自定义列名1.3 衍生表的局限在SQL的查询语句select

MySQL 横向衍生表(Lateral Derived Tables)的实现

《MySQL横向衍生表(LateralDerivedTables)的实现》横向衍生表适用于在需要通过子查询获取中间结果集的场景,相对于普通衍生表,横向衍生表可以引用在其之前出现过的表名,本文就来... 目录一、横向衍生表用法示例1.1 用法示例1.2 使用建议前面我们介绍过mysql中的衍生表(From子句

六个案例搞懂mysql间隙锁

《六个案例搞懂mysql间隙锁》MySQL中的间隙是指索引中两个索引键之间的空间,间隙锁用于防止范围查询期间的幻读,本文主要介绍了六个案例搞懂mysql间隙锁,具有一定的参考价值,感兴趣的可以了解一下... 目录概念解释间隙锁详解间隙锁触发条件间隙锁加锁规则案例演示案例一:唯一索引等值锁定存在的数据案例二:

MySQL JSON 查询中的对象与数组技巧及查询示例

《MySQLJSON查询中的对象与数组技巧及查询示例》MySQL中JSON对象和JSON数组查询的详细介绍及带有WHERE条件的查询示例,本文给大家介绍的非常详细,mysqljson查询示例相关知... 目录jsON 对象查询1. JSON_CONTAINS2. JSON_EXTRACT3. JSON_TA

MySQL 设置AUTO_INCREMENT 无效的问题解决

《MySQL设置AUTO_INCREMENT无效的问题解决》本文主要介绍了MySQL设置AUTO_INCREMENT无效的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参... 目录快速设置mysql的auto_increment参数一、修改 AUTO_INCREMENT 的值。