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

相关文章

MySQL 中的 CAST 函数详解及常见用法

《MySQL中的CAST函数详解及常见用法》CAST函数是MySQL中用于数据类型转换的重要函数,它允许你将一个值从一种数据类型转换为另一种数据类型,本文给大家介绍MySQL中的CAST... 目录mysql 中的 CAST 函数详解一、基本语法二、支持的数据类型三、常见用法示例1. 字符串转数字2. 数字

Mysql实现范围分区表(新增、删除、重组、查看)

《Mysql实现范围分区表(新增、删除、重组、查看)》MySQL分区表的四种类型(范围、哈希、列表、键值),主要介绍了范围分区的创建、查询、添加、删除及重组织操作,具有一定的参考价值,感兴趣的可以了解... 目录一、mysql分区表分类二、范围分区(Range Partitioning1、新建分区表:2、分

MySQL 定时新增分区的实现示例

《MySQL定时新增分区的实现示例》本文主要介绍了通过存储过程和定时任务实现MySQL分区的自动创建,解决大数据量下手动维护的繁琐问题,具有一定的参考价值,感兴趣的可以了解一下... mysql创建好分区之后,有时候会需要自动创建分区。比如,一些表数据量非常大,有些数据是热点数据,按照日期分区MululbU

SQL Server配置管理器无法打开的四种解决方法

《SQLServer配置管理器无法打开的四种解决方法》本文总结了SQLServer配置管理器无法打开的四种解决方法,文中通过图文示例介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的... 目录方法一:桌面图标进入方法二:运行窗口进入检查版本号对照表php方法三:查找文件路径方法四:检查 S

MySQL 删除数据详解(最新整理)

《MySQL删除数据详解(最新整理)》:本文主要介绍MySQL删除数据的相关知识,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录一、前言二、mysql 中的三种删除方式1.DELETE语句✅ 基本语法: 示例:2.TRUNCATE语句✅ 基本语

MySQL中查找重复值的实现

《MySQL中查找重复值的实现》查找重复值是一项常见需求,比如在数据清理、数据分析、数据质量检查等场景下,我们常常需要找出表中某列或多列的重复值,具有一定的参考价值,感兴趣的可以了解一下... 目录技术背景实现步骤方法一:使用GROUP BY和HAVING子句方法二:仅返回重复值方法三:返回完整记录方法四:

从入门到精通MySQL联合查询

《从入门到精通MySQL联合查询》:本文主要介绍从入门到精通MySQL联合查询,本文通过实例代码给大家介绍的非常详细,需要的朋友可以参考下... 目录摘要1. 多表联合查询时mysql内部原理2. 内连接3. 外连接4. 自连接5. 子查询6. 合并查询7. 插入查询结果摘要前面我们学习了数据库设计时要满

MySQL查询JSON数组字段包含特定字符串的方法

《MySQL查询JSON数组字段包含特定字符串的方法》在MySQL数据库中,当某个字段存储的是JSON数组,需要查询数组中包含特定字符串的记录时传统的LIKE语句无法直接使用,下面小编就为大家介绍两种... 目录问题背景解决方案对比1. 精确匹配方案(推荐)2. 模糊匹配方案参数化查询示例使用场景建议性能优

Java内存分配与JVM参数详解(推荐)

《Java内存分配与JVM参数详解(推荐)》本文详解JVM内存结构与参数调整,涵盖堆分代、元空间、GC选择及优化策略,帮助开发者提升性能、避免内存泄漏,本文给大家介绍Java内存分配与JVM参数详解,... 目录引言JVM内存结构JVM参数概述堆内存分配年轻代与老年代调整堆内存大小调整年轻代与老年代比例元空

mysql表操作与查询功能详解

《mysql表操作与查询功能详解》本文系统讲解MySQL表操作与查询,涵盖创建、修改、复制表语法,基本查询结构及WHERE、GROUPBY等子句,本文结合实例代码给大家介绍的非常详细,感兴趣的朋友跟随... 目录01.表的操作1.1表操作概览1.2创建表1.3修改表1.4复制表02.基本查询操作2.1 SE